Documentation
¶
Overview ¶
* OAuth Module Session Definitions * This session object is used internally to transfer user and expiry information to the storage providers * * AuthPlz Project (https://github.com/authplz/authplz-core) * Copyright 2017 Ryan Kurte
Index ¶
- Constants
- Variables
- func BindOauthContext(oc *Controller) func(ctx *APICtx, rw web.ResponseWriter, req *web.Request, ...)
- func NewAccessTokenWrap(i interface{}) interface{}
- func NewAuthorizeCodeWrap(i interface{}) fosite.Requester
- func NewClientWrapper(c interface{}) fosite.Client
- func NewRefreshTokenWrap(i interface{}) interface{}
- func NewSessionWrap(s interface{}) fosite.Session
- func PackRequest(req *fosite.Request) (string, error)
- func UnpackRequest(data string) (fosite.Request, error)
- type APICtx
- func (c *APICtx) AccessTokenInfoGet(rw web.ResponseWriter, req *web.Request)
- func (c *APICtx) AuthorizeConfirmPost(rw web.ResponseWriter, req *web.Request)
- func (c *APICtx) AuthorizePendingGet(rw web.ResponseWriter, req *web.Request)
- func (c *APICtx) AuthorizeRequestGet(rw web.ResponseWriter, req *web.Request)
- func (c *APICtx) ClientsGet(rw web.ResponseWriter, req *web.Request)
- func (c *APICtx) ClientsPost(rw web.ResponseWriter, req *web.Request)
- func (c *APICtx) IntrospectPost(rw web.ResponseWriter, req *web.Request)
- func (c *APICtx) OptionsGet(rw web.ResponseWriter, req *web.Request)
- func (c *APICtx) SessionsInfoGet(rw web.ResponseWriter, req *web.Request)
- func (c *APICtx) TokenPost(rw web.ResponseWriter, req *web.Request)
- type AccessTokenInfo
- type AccessTokenSession
- type AccessTokenWrap
- func (s *AccessTokenWrap) GetClient() fosite.Client
- func (s *AccessTokenWrap) GetGrantedScopes() fosite.Arguments
- func (s *AccessTokenWrap) GetID() string
- func (s *AccessTokenWrap) GetRequestForm() url.Values
- func (s *AccessTokenWrap) GetRequestedScopes() fosite.Arguments
- func (s *AccessTokenWrap) GetSession() fosite.Session
- func (s *AccessTokenWrap) Merge(requester fosite.Requester)
- func (s *AccessTokenWrap) SetRequestedScopes(scopes fosite.Arguments)
- func (s *AccessTokenWrap) SetSession(session fosite.Session)
- type AuthorizationRequest
- type AuthorizeCodeSession
- type AuthorizeCodeWrap
- func (s *AuthorizeCodeWrap) GetClient() fosite.Client
- func (s *AuthorizeCodeWrap) GetGrantedScopes() fosite.Arguments
- func (s *AuthorizeCodeWrap) GetID() string
- func (s *AuthorizeCodeWrap) GetRequestForm() url.Values
- func (s *AuthorizeCodeWrap) GetRequestedScopes() fosite.Arguments
- func (s *AuthorizeCodeWrap) GetSession() fosite.Session
- func (s *AuthorizeCodeWrap) Merge(requester fosite.Requester)
- func (s *AuthorizeCodeWrap) SetID(id string)
- func (s *AuthorizeCodeWrap) SetRequestedScopes(scopes fosite.Arguments)
- func (s *AuthorizeCodeWrap) SetSession(session fosite.Session)
- type AuthorizeConfirm
- type Client
- type ClientReq
- type ClientResp
- type ClientWrapper
- type Controller
- func (oc *Controller) BindAPI(base *web.Router) *web.Router
- func (oc *Controller) CreateClient(userID, clientName string, ...) (*ClientResp, error)
- func (oc *Controller) GetAccessTokenInfo(tokenString string) (*AccessTokenInfo, error)
- func (oc *Controller) GetClients(userID string) ([]ClientResp, error)
- func (oc *Controller) GetOptions(userID string) (*OptionResp, error)
- func (oc *Controller) GetUserSessions(userID string) (*UserSessions, error)
- func (oc *Controller) RemoveClient(clientID string) error
- func (oc *Controller) UpdateClient(client Client) error
- type FositeAdaptor
- func (oa *FositeAdaptor) CreateAccessTokenSession(c context.Context, signature string, request fosite.Requester) (err error)
- func (oa *FositeAdaptor) CreateAuthorizeCodeSession(ctx context.Context, code string, request fosite.Requester) (err error)
- func (oa *FositeAdaptor) CreateRefreshTokenSession(ctx context.Context, signature string, request fosite.Requester) (err error)
- func (oa *FositeAdaptor) DeleteAccessTokenSession(ctx context.Context, signature string) (err error)
- func (oa *FositeAdaptor) DeleteAuthorizeCodeSession(ctx context.Context, code string) (err error)
- func (oa *FositeAdaptor) DeleteRefreshTokenSession(ctx context.Context, signature string) (err error)
- func (oa *FositeAdaptor) GetAccessTokenSession(ctx context.Context, signature string, session fosite.Session) (request fosite.Requester, err error)
- func (oa *FositeAdaptor) GetAuthorizeCodeSession(ctx context.Context, code string, session fosite.Session) (request fosite.Requester, err error)
- func (oa *FositeAdaptor) GetClient(ctx context.Context, id string) (fosite.Client, error)
- func (oa *FositeAdaptor) GetRefreshTokenSession(ctx context.Context, signature string, session fosite.Session) (request fosite.Requester, err error)
- func (oa *FositeAdaptor) PersistAuthorizeCodeGrantSession(ctx context.Context, authorizeCode, accessSignature, refreshSignature string, ...) error
- func (oa *FositeAdaptor) PersistRefreshTokenGrantSession(ctx context.Context, ...) error
- func (oa *FositeAdaptor) RevokeAccessToken(ctx context.Context, requestID string) error
- func (oa *FositeAdaptor) RevokeRefreshToken(ctx context.Context, requestID string) error
- type GrantInfo
- type OptionResp
- type RefreshTokenSession
- type RefreshTokenWrap
- func (s *RefreshTokenWrap) GetClient() fosite.Client
- func (s *RefreshTokenWrap) GetGrantedScopes() fosite.Arguments
- func (s *RefreshTokenWrap) GetID() string
- func (s *RefreshTokenWrap) GetRequestForm() url.Values
- func (s *RefreshTokenWrap) GetRequestedScopes() fosite.Arguments
- func (s *RefreshTokenWrap) GetSession() fosite.Session
- func (s *RefreshTokenWrap) Merge(requester fosite.Requester)
- func (s *RefreshTokenWrap) SetRequestedScopes(scopes fosite.Arguments)
- func (s *RefreshTokenWrap) SetSession(session fosite.Session)
- type Session
- func (s *Session) Clone() interface{}
- func (s *Session) GetAccessExpiry() time.Time
- func (s *Session) GetAuthorizeExpiry() time.Time
- func (s *Session) GetIDExpiry() time.Time
- func (s *Session) GetRefreshExpiry() time.Time
- func (s *Session) GetSubject() string
- func (s *Session) GetUserID() string
- func (s *Session) GetUsername() string
- func (s *Session) SetAccessExpiry(t time.Time)
- func (s *Session) SetAuthorizeExpiry(t time.Time)
- func (s *Session) SetIDExpiry(t time.Time)
- func (s *Session) SetRefreshExpiry(t time.Time)
- type SessionBase
- type SessionWrap
- type Storer
- type User
- type UserSession
- type UserSessions
Constants ¶
const ( //OAuthSecretBytes is the length of OAuth secrets OAuthSecretBytes int = 32 )
Variables ¶
var ErrInternal = errors.New("OAuth internal error")
ErrInternal indicates an internal error in the OAuth controller This is a safe error return for the OAuth API to wrap underlying errors
Functions ¶
func BindOauthContext ¶
func BindOauthContext(oc *Controller) func(ctx *APICtx, rw web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)
BindOauthContext Helper middleware to bind module controller to API context
func NewAccessTokenWrap ¶
func NewAccessTokenWrap(i interface{}) interface{}
func NewAuthorizeCodeWrap ¶
func NewClientWrapper ¶
NewClientWrapper creates a client wrapper around a Client interface object to support the methods required by Fosite
func NewRefreshTokenWrap ¶
func NewRefreshTokenWrap(i interface{}) interface{}
func NewSessionWrap ¶
NewSessionWrap creates a session wrapper around a session object to support the methods required by fosite
Types ¶
type APICtx ¶
type APICtx struct {
// Base context required by router
*appcontext.AuthPlzCtx
// contains filtered or unexported fields
}
APICtx API context instance
func (*APICtx) AccessTokenInfoGet ¶
func (c *APICtx) AccessTokenInfoGet(rw web.ResponseWriter, req *web.Request)
AccessTokenInfoGet Access Token Information endpoint
func (*APICtx) AuthorizeConfirmPost ¶
func (c *APICtx) AuthorizeConfirmPost(rw web.ResponseWriter, req *web.Request)
AuthorizeConfirmPost Confirm authorization of a token This finalises and stores the authentication, and redirects back to the calling service TODO: this endpoint /really/ needs CSRF / CORS protection
func (*APICtx) AuthorizePendingGet ¶
func (c *APICtx) AuthorizePendingGet(rw web.ResponseWriter, req *web.Request)
AuthorizePendingGet Fetch pending authorizations for a user
func (*APICtx) AuthorizeRequestGet ¶
func (c *APICtx) AuthorizeRequestGet(rw web.ResponseWriter, req *web.Request)
AuthorizeRequestGet External OAuth authorization endpoint
func (*APICtx) ClientsGet ¶
func (c *APICtx) ClientsGet(rw web.ResponseWriter, req *web.Request)
ClientsGet Lists clients bound owned by a user account
func (*APICtx) ClientsPost ¶
func (c *APICtx) ClientsPost(rw web.ResponseWriter, req *web.Request)
ClientsPost creates a new OAuth client
func (*APICtx) IntrospectPost ¶
func (c *APICtx) IntrospectPost(rw web.ResponseWriter, req *web.Request)
IntrospectPost Token Introspection endpoint
func (*APICtx) OptionsGet ¶
func (c *APICtx) OptionsGet(rw web.ResponseWriter, req *web.Request)
OptionsGet fetch OAuth client options
func (*APICtx) SessionsInfoGet ¶
func (c *APICtx) SessionsInfoGet(rw web.ResponseWriter, req *web.Request)
SessionsInfoGet Lists authorized sessions for a user
type AccessTokenInfo ¶
AccessTokenInfo is an access token information response
type AccessTokenSession ¶
type AccessTokenSession interface {
SessionBase
GetSignature() string
}
AccessTokenSession is an OAuth Access Token Session
type AccessTokenWrap ¶
type AccessTokenWrap struct {
AccessTokenSession
}
func (*AccessTokenWrap) GetClient ¶
func (s *AccessTokenWrap) GetClient() fosite.Client
func (*AccessTokenWrap) GetGrantedScopes ¶
func (s *AccessTokenWrap) GetGrantedScopes() fosite.Arguments
func (*AccessTokenWrap) GetID ¶
func (s *AccessTokenWrap) GetID() string
func (*AccessTokenWrap) GetRequestForm ¶
func (s *AccessTokenWrap) GetRequestForm() url.Values
func (*AccessTokenWrap) GetRequestedScopes ¶
func (s *AccessTokenWrap) GetRequestedScopes() fosite.Arguments
func (*AccessTokenWrap) GetSession ¶
func (s *AccessTokenWrap) GetSession() fosite.Session
func (*AccessTokenWrap) Merge ¶
func (s *AccessTokenWrap) Merge(requester fosite.Requester)
func (*AccessTokenWrap) SetRequestedScopes ¶
func (s *AccessTokenWrap) SetRequestedScopes(scopes fosite.Arguments)
func (*AccessTokenWrap) SetSession ¶
func (s *AccessTokenWrap) SetSession(session fosite.Session)
type AuthorizationRequest ¶
type AuthorizationRequest struct {
State string `json:"state"`
Name string `json:"name"`
RedirectURI string `json:"redirect_uri"`
Scopes []string `json:"requested_scopes"`
}
AuthorizationRequest is a pending authorization request to be accepted by the user
type AuthorizeCodeSession ¶
type AuthorizeCodeSession interface {
SessionBase
GetCode() string
}
AuthorizeCodeSession is an OAuth Authorization Code Grant Session
type AuthorizeCodeWrap ¶
type AuthorizeCodeWrap struct {
AuthorizeCodeSession
}
func (*AuthorizeCodeWrap) GetClient ¶
func (s *AuthorizeCodeWrap) GetClient() fosite.Client
func (*AuthorizeCodeWrap) GetGrantedScopes ¶
func (s *AuthorizeCodeWrap) GetGrantedScopes() fosite.Arguments
func (*AuthorizeCodeWrap) GetID ¶
func (s *AuthorizeCodeWrap) GetID() string
func (*AuthorizeCodeWrap) GetRequestForm ¶
func (s *AuthorizeCodeWrap) GetRequestForm() url.Values
func (*AuthorizeCodeWrap) GetRequestedScopes ¶
func (s *AuthorizeCodeWrap) GetRequestedScopes() fosite.Arguments
func (*AuthorizeCodeWrap) GetSession ¶
func (s *AuthorizeCodeWrap) GetSession() fosite.Session
func (*AuthorizeCodeWrap) Merge ¶
func (s *AuthorizeCodeWrap) Merge(requester fosite.Requester)
func (*AuthorizeCodeWrap) SetID ¶
func (s *AuthorizeCodeWrap) SetID(id string)
func (*AuthorizeCodeWrap) SetRequestedScopes ¶
func (s *AuthorizeCodeWrap) SetRequestedScopes(scopes fosite.Arguments)
func (*AuthorizeCodeWrap) SetSession ¶
func (s *AuthorizeCodeWrap) SetSession(session fosite.Session)
type AuthorizeConfirm ¶
type AuthorizeConfirm struct {
Accept bool `json:"accept"`
State string `json:"state"`
GrantedScopes []string `json:"granted_scopes"`
}
AuthorizeConfirm is the confirmation for a given authorization request
type Client ¶
type Client interface {
GetID() string
GetName() string
GetSecret() string
GetRedirectURIs() []string
GetUserData() interface{}
GetScopes() []string
GetGrantTypes() []string
GetResponseTypes() []string
IsPublic() bool
GetCreatedAt() time.Time
GetLastUsed() time.Time
SetLastUsed(time.Time)
}
Client OAuth client application interface
type ClientReq ¶
type ClientReq struct {
Name string `json:"name"`
Scopes []string `json:"scopes"`
Redirects []string `json:"redirects"`
Grants []string `json:"grant_types"`
Responses []string `json:"response_types"`
}
ClientReq is a client request object used to create an OAuth client
type ClientResp ¶
type ClientResp struct {
ClientID string `json:"id"`
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
LastUsed time.Time `json:"last_used"`
Scopes []string `json:"allowed_scopes"`
GrantTypes []string `json:"grant_types"`
ResponseTypes []string `json:"response_types"`
RedirectURIs []string `json:"redirect_uris"`
Secret string `json:"secret"`
}
ClientResp is the API safe object returned by client requests
type ClientWrapper ¶
type ClientWrapper struct {
Client
}
ClientWrapper overrides Client interface with Fosite specific types
func (ClientWrapper) GetGrantTypes ¶
func (c ClientWrapper) GetGrantTypes() fosite.Arguments
func (ClientWrapper) GetHashedSecret ¶
func (c ClientWrapper) GetHashedSecret() []byte
func (ClientWrapper) GetRedirectURIs ¶
func (c ClientWrapper) GetRedirectURIs() []string
func (ClientWrapper) GetResponseTypes ¶
func (c ClientWrapper) GetResponseTypes() fosite.Arguments
func (ClientWrapper) GetScopes ¶
func (c ClientWrapper) GetScopes() fosite.Arguments
type Controller ¶
type Controller struct {
OAuth2 fosite.OAuth2Provider
// contains filtered or unexported fields
}
Controller OAuth module controller
func NewController ¶
func NewController(store Storer, config config.OAuthConfig) *Controller
NewController Creates a new OAuth2 controller instance
func (*Controller) BindAPI ¶
func (oc *Controller) BindAPI(base *web.Router) *web.Router
BindAPI Binds oauth API endpoints to the provded router
func (*Controller) CreateClient ¶
func (oc *Controller) CreateClient(userID, clientName string, scopes, redirects, grantTypes, responseTypes []string, public bool) (*ClientResp, error)
CreateClient Creates an OAuth Client Credential grant based client for a given user This is used to authenticate simple devices and must be pre-created
func (*Controller) GetAccessTokenInfo ¶
func (oc *Controller) GetAccessTokenInfo(tokenString string) (*AccessTokenInfo, error)
GetAccessTokenInfo fetches information for a provided access token
func (*Controller) GetClients ¶
func (oc *Controller) GetClients(userID string) ([]ClientResp, error)
GetClients Fetch clients owned by a given user
func (*Controller) GetOptions ¶
func (oc *Controller) GetOptions(userID string) (*OptionResp, error)
func (*Controller) GetUserSessions ¶
func (oc *Controller) GetUserSessions(userID string) (*UserSessions, error)
GetUserSessions fetches a list of all OAuth sessions for a given user ID
func (*Controller) RemoveClient ¶
func (oc *Controller) RemoveClient(clientID string) error
RemoveClient Removes a client instance
func (*Controller) UpdateClient ¶
func (oc *Controller) UpdateClient(client Client) error
UpdateClient Update a client instance
type FositeAdaptor ¶
type FositeAdaptor struct {
Storer Storer
}
FositeAdaptor adapts a generic interface for osin compliance
func NewAdaptor ¶
func NewAdaptor(s Storer) *FositeAdaptor
NewAdaptor creates a new wraper/adaptor around a Storer interface
func (*FositeAdaptor) CreateAccessTokenSession ¶
func (*FositeAdaptor) CreateAuthorizeCodeSession ¶
func (*FositeAdaptor) CreateRefreshTokenSession ¶
func (*FositeAdaptor) DeleteAccessTokenSession ¶
func (oa *FositeAdaptor) DeleteAccessTokenSession(ctx context.Context, signature string) (err error)
func (*FositeAdaptor) DeleteAuthorizeCodeSession ¶
func (oa *FositeAdaptor) DeleteAuthorizeCodeSession(ctx context.Context, code string) (err error)
func (*FositeAdaptor) DeleteRefreshTokenSession ¶
func (oa *FositeAdaptor) DeleteRefreshTokenSession(ctx context.Context, signature string) (err error)
func (*FositeAdaptor) GetAccessTokenSession ¶
func (*FositeAdaptor) GetAuthorizeCodeSession ¶
func (*FositeAdaptor) GetRefreshTokenSession ¶
func (*FositeAdaptor) PersistAuthorizeCodeGrantSession ¶
func (*FositeAdaptor) PersistRefreshTokenGrantSession ¶
func (*FositeAdaptor) RevokeAccessToken ¶
func (oa *FositeAdaptor) RevokeAccessToken(ctx context.Context, requestID string) error
func (*FositeAdaptor) RevokeRefreshToken ¶
func (oa *FositeAdaptor) RevokeRefreshToken(ctx context.Context, requestID string) error
type OptionResp ¶
type RefreshTokenSession ¶
type RefreshTokenSession interface {
SessionBase
GetSignature() string
}
RefreshTokenSession is an OAuth Refresh Token Session
type RefreshTokenWrap ¶
type RefreshTokenWrap struct {
RefreshTokenSession
}
func (*RefreshTokenWrap) GetClient ¶
func (s *RefreshTokenWrap) GetClient() fosite.Client
func (*RefreshTokenWrap) GetGrantedScopes ¶
func (s *RefreshTokenWrap) GetGrantedScopes() fosite.Arguments
func (*RefreshTokenWrap) GetID ¶
func (s *RefreshTokenWrap) GetID() string
func (*RefreshTokenWrap) GetRequestForm ¶
func (s *RefreshTokenWrap) GetRequestForm() url.Values
func (*RefreshTokenWrap) GetRequestedScopes ¶
func (s *RefreshTokenWrap) GetRequestedScopes() fosite.Arguments
func (*RefreshTokenWrap) GetSession ¶
func (s *RefreshTokenWrap) GetSession() fosite.Session
func (*RefreshTokenWrap) Merge ¶
func (s *RefreshTokenWrap) Merge(requester fosite.Requester)
func (*RefreshTokenWrap) SetRequestedScopes ¶
func (s *RefreshTokenWrap) SetRequestedScopes(scopes fosite.Arguments)
func (*RefreshTokenWrap) SetSession ¶
func (s *RefreshTokenWrap) SetSession(session fosite.Session)
type Session ¶
type Session struct {
UserID string
Username string
Subject string
AccessExpiry time.Time
RefreshExpiry time.Time
AuthorizeExpiry time.Time
IDExpiry time.Time
}
Session is an OAuth session for module use Relevant data is persisted with each grant type object and returned using a similar object meeting the UserSession interface from the datastore
func NewSession ¶
NewSession creates a new default session instance for a given user
func (*Session) GetAccessExpiry ¶
func (*Session) GetAuthorizeExpiry ¶
func (*Session) GetIDExpiry ¶
func (*Session) GetRefreshExpiry ¶
func (*Session) GetSubject ¶
func (*Session) GetUsername ¶
func (*Session) SetAccessExpiry ¶
func (*Session) SetAuthorizeExpiry ¶
func (*Session) SetIDExpiry ¶
func (*Session) SetRefreshExpiry ¶
type SessionBase ¶
type SessionBase interface {
GetClient() interface{}
GetSession() interface{}
SetSession(session interface{})
GetRequestID() string
SetRequestID(string)
GetUserID() string
GetRequestedAt() time.Time
GetExpiresAt() time.Time
GetRequestedScopes() []string
SetRequestedScopes(scopes []string)
AppendRequestedScope(scope string)
GetGrantedScopes() []string
GrantScope(scope string)
Merge(interface{})
}
SessionBase defines the common interface across all OAuth sessions
type SessionWrap ¶
type SessionWrap struct {
UserSession
}
SessionWrap overrides the Session interface with Fosite specific types
func (*SessionWrap) Clone ¶
func (s *SessionWrap) Clone() fosite.Session
func (*SessionWrap) GetExpiresAt ¶
func (session *SessionWrap) GetExpiresAt(key fosite.TokenType) time.Time
GetExpiresAt fetches the expiry date for a given token type
func (*SessionWrap) GetSubject ¶
func (s *SessionWrap) GetSubject() string
func (*SessionWrap) GetUsername ¶
func (s *SessionWrap) GetUsername() string
func (*SessionWrap) SetExpiresAt ¶
func (session *SessionWrap) SetExpiresAt(key fosite.TokenType, exp time.Time)
SetExpiresAt sets the expiry date of a session instance
type Storer ¶
type Storer interface {
// User storage
GetUserByExtID(userid string) (interface{}, error)
// Client (application) storage
AddClient(userID, clientID, clientName, secret string, scopes, redirects, grantTypes, responseTypes []string, public bool) (interface{}, error)
GetClientByID(clientID string) (interface{}, error)
GetClientsByUserID(userID string) ([]interface{}, error)
UpdateClient(client interface{}) (interface{}, error)
RemoveClientByID(clientID string) error
// Authorization code storage
AddAuthorizeCodeSession(userID, clientID, code, requestID string, requestedAt, expiresAt time.Time, scopes, grantedScopes []string) (interface{}, error)
GetAuthorizeCodeSession(code string) (interface{}, error)
GetAuthorizeCodeSessionByRequestID(requestID string) (interface{}, error)
GetAuthorizeCodeSessionsByUserID(userID string) ([]interface{}, error)
RemoveAuthorizeCodeSession(code string) error
// Access Token storage
AddAccessTokenSession(userID, clientID, signature, requestID string, requestedAt, expiresAt time.Time,
scopes, grantedScopes []string) (interface{}, error)
GetAccessTokenSession(sgnature string) (interface{}, error)
GetClientByAccessTokenSession(token string) (interface{}, error)
GetAccessTokenSessionByRequestID(requestID string) (interface{}, error)
GetAccessTokenSessionsByUserID(userID string) ([]interface{}, error)
RemoveAccessTokenSession(token string) error
// Refresh token storage
AddRefreshTokenSession(userID, clientID, signature, requestID string, requestedAt, expiresAt time.Time, scopes, grantedScopes []string) (interface{}, error)
GetRefreshTokenBySignature(signature string) (interface{}, error)
GetRefreshTokenSessionByRequestID(requestID string) (interface{}, error)
GetRefreshTokenSessionsByUserID(userID string) ([]interface{}, error)
RemoveRefreshToken(signature string) error
}
Storer OAuth storage interface This must be implemented by the underlying storage device
type UserSession ¶
type UserSession interface {
GetUserID() string
GetUsername() string
GetSubject() string
// Get and Set expiry times
SetAccessExpiry(time.Time)
GetAccessExpiry() time.Time
SetRefreshExpiry(time.Time)
GetRefreshExpiry() time.Time
SetAuthorizeExpiry(time.Time)
GetAuthorizeExpiry() time.Time
SetIDExpiry(time.Time)
GetIDExpiry() time.Time
Clone() interface{}
}
UserSession is user data associated with an OAuth session