Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTokenStore ¶
func NewTokenStore(client *hazelcast.Client, opts ...TokenStoreOption) (oauth2.TokenStore, error)
NewTokenStore creates an instances of `oauth2.TokenStore` connected to a Hazelcast cluster. This implementation relies on Hazelcast maps to manage access tokens, refresh tokens, and codes. By default, access tokens, refresh toknes, and codes are stored in maps oauth2_access_tokens, oauth2_refresh_tokens, and oauth2_codes respectively, but this can be changed by `WithAccessMapName`, `WithRefreshMapName`, and `WithCodesMapName` options. This package assumes that it will be supplied with a valid Hazelcast client, leaving the connecting/disconnecting to the cluser to its users.
Types ¶
type TokenStoreOption ¶
type TokenStoreOption func(ts *tokenStore) error
TokenStoreOption is a function that can be used to modify behavior of the `tokenStore`.
func WithAccessMapName ¶
func WithAccessMapName(name string) TokenStoreOption
WithAccessMapName sets the name of the map that is used to save access tokens. An error is returned if the name is empty.
func WithCodesMapName ¶
func WithCodesMapName(name string) TokenStoreOption
WithCodesMapName sets the name of the map that is used to save codes. An error is returned if the name is empty.
func WithRefreshMapName ¶
func WithRefreshMapName(name string) TokenStoreOption
WithRefreshMapName sets the name of the map that is used to save refresh tokens. An error is returned if the name is empty.