Documentation ¶
Index ¶
- func InitServer(cfg *config.Config, manager oauth2.Manager, ...) *oauth2server.Server
- func NewManager(tokenStore oauth2.TokenStore, clientStore oauth2.ClientStore, ...) oauth2.Manager
- type JWTAccess
- type JWTAccessClaims
- type TokenStore
- func (ts *TokenStore) Create(ctx context.Context, info oauth2.TokenInfo) error
- func (ts *TokenStore) GetByAccess(ctx context.Context, access string) (oauth2.TokenInfo, error)
- func (ts *TokenStore) GetByCode(ctx context.Context, code string) (oauth2.TokenInfo, error)
- func (ts *TokenStore) GetByRefresh(ctx context.Context, refresh string) (oauth2.TokenInfo, error)
- func (ts *TokenStore) RemoveByAccess(ctx context.Context, access string) error
- func (ts *TokenStore) RemoveByCode(ctx context.Context, code string) error
- func (ts *TokenStore) RemoveByRefresh(ctx context.Context, refresh string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitServer ¶
func InitServer( cfg *config.Config, manager oauth2.Manager, clientRepository persistence.ClientRepository, timeout time.Duration, ) *oauth2server.Server
InitServer initialize the oauth2 server instance
func NewManager ¶
func NewManager(tokenStore oauth2.TokenStore, clientStore oauth2.ClientStore, authenticator auth.Authenticator, clientRepository persistence.ClientRepository) oauth2.Manager
NewManager initialize the oauth2 manager service
Types ¶
type JWTAccess ¶
type JWTAccess struct {
// contains filtered or unexported fields
}
JWTAccess generate the jwt access token
func NewJWTAccess ¶
func NewJWTAccess(method jwt.SigningMethod, authenticator auth.Authenticator, clientRepository persistence.ClientRepository) *JWTAccess
NewJWTAccess create to generate the jwt access token instance
type JWTAccessClaims ¶
JWTAccessClaims jwt claims
type TokenStore ¶
type TokenStore struct {
// contains filtered or unexported fields
}
TokenStore token storage
func NewTokenStore ¶
func NewTokenStore(persistenceRepository persistence.TokenRepository, eventSourcedRepository token.Repository) *TokenStore
NewTokenStore create a token store instance
func (*TokenStore) Create ¶
func (ts *TokenStore) Create(ctx context.Context, info oauth2.TokenInfo) error
Create create and store the new token information
func (*TokenStore) GetByAccess ¶
func (ts *TokenStore) GetByAccess(ctx context.Context, access string) (oauth2.TokenInfo, error)
GetByAccess use the access token for token information data
func (*TokenStore) GetByCode ¶
func (ts *TokenStore) GetByCode(ctx context.Context, code string) (oauth2.TokenInfo, error)
GetByCode use the authorization code for token information data
func (*TokenStore) GetByRefresh ¶
func (ts *TokenStore) GetByRefresh(ctx context.Context, refresh string) (oauth2.TokenInfo, error)
GetByRefresh use the refresh token for token information data
func (*TokenStore) RemoveByAccess ¶
func (ts *TokenStore) RemoveByAccess(ctx context.Context, access string) error
RemoveByAccess use the access token to delete the token information
func (*TokenStore) RemoveByCode ¶
func (ts *TokenStore) RemoveByCode(ctx context.Context, code string) error
RemoveByCode use the authorization code to delete the token information
func (*TokenStore) RemoveByRefresh ¶
func (ts *TokenStore) RemoveByRefresh(ctx context.Context, refresh string) error
RemoveByRefresh use the refresh token to delete the token information