jwt

package
v0.0.1-build.42 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2022 License: MIT Imports: 8 Imported by: 0

README

  • jwt should have a short livetime.
  • jwt should be provided with a refresh token.
  • refresh token should be trick to use and burn.
  • when a refresh token had been burned any jwt corresponding to this refresh token should be invalid.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(eng *engine.Engine, prefix string, tokenLifeTime time.Duration, refreshLifeTime time.Duration, ppk *rsa.PrivateKey) (*Client, error)

func (*Client) Authenticate

func (client *Client) Authenticate(clientID goauth.AccountID, response goauth.IResponse) (bool, error)

the verify authentication for jwt is not nessasary.

func (*Client) BeginSession

func (client *Client) BeginSession(clientID goauth.AccountID, adapter goauth.IAdapter) (goauth.ISession, error)

frontend request to begin a signin process.

func (*Client) GetClientType

func (client *Client) GetClientType() goauth.ClientType

MARK: implement IAuthClient

func (*Client) GetKey

func (client *Client) GetKey(refreshToken string) string

func (*Client) RenewSession

func (client *Client) RenewSession(refreshToken string) (goauth.ISession, error)

func (*Client) Verify

func (client *Client) Verify(session goauth.ISession, response goauth.IResponse, adapter goauth.IAdapter) (bool, error)

verifying jwt

type JWTSession

type JWTSession struct {
	JWT        goauth.SessionID `json:"SessionID"`
	Identifier string           `json:"Identifier"`
}

func NewSession

func NewSession(jwt goauth.SessionID, identifier string) *JWTSession

func (*JWTSession) GetClientAccountID

func (session *JWTSession) GetClientAccountID() goauth.AccountID

func (*JWTSession) GetClientType

func (session *JWTSession) GetClientType() goauth.ClientType

func (*JWTSession) GetSessionID

func (session *JWTSession) GetSessionID() goauth.SessionID

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL