Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotImplemented = errors.New("function not implemented") ErrAccessTokenExpired = errors.New("access_token expired or unauthorized") )
Standard errors.
Functions ¶
This section is empty.
Types ¶
type DiscoveryDoc ¶
type DiscoveryDoc struct { Issuer string `json:"issuer,omitempty"` AuthEndpoint string `json:"authorization_endpoint,omitempty"` TokenEndpoint string `json:"token_endpoint,omitempty"` UserInfoEndpoint string `json:"userinfo_endpoint,omitempty"` RevocationEndpoint string `json:"revocation_endpoint,omitempty"` JwksURI string `json:"jwks_uri,omitempty"` ResponseTypesSupported []string `json:"response_types_supported,omitempty"` SubjectTypesSupported []string `json:"subject_types_supported,omitempty"` IDTokenSigningAlgValuesSupported []string `json:"id_token_signing_alg_values_supported,omitempty"` ScopesSupported []string `json:"scopes_supported,omitempty"` TokenEndpointAuthMethods []string `json:"token_endpoint_auth_methods_supported,omitempty"` ClaimsSupported []string `json:"claims_supported,omitempty"` CodeChallengeMethodsSupported []string `json:"code_challenge_methods_supported,omitempty"` }
DiscoveryDoc - parses the output from openid-configuration for example https://accounts.google.com/.well-known/openid-configuration
type KeycloakProvider ¶
KeycloakProvider implements Provider interface for KeyCloak Identity Provider.
func (*KeycloakProvider) LoginWithClientID ¶
func (k *KeycloakProvider) LoginWithClientID(clientID, clientSecret string) error
LoginWithClientID is implemented by Keycloak service account support
func (*KeycloakProvider) LoginWithUser ¶
func (k *KeycloakProvider) LoginWithUser(username, password string) error
LoginWithUser authenticates username/password, not needed for Keycloak
func (*KeycloakProvider) LookupUser ¶
func (k *KeycloakProvider) LookupUser(userid string) (User, error)
LookupUser lookup user by their userid.
type Option ¶
type Option func(*KeycloakProvider)
Option is a function type that accepts a pointer Target
func WithAdminURL ¶
WithAdminURL provide admin URL configuration for Keycloak
func WithOpenIDConfig ¶
func WithOpenIDConfig(oeConfig DiscoveryDoc) Option
WithOpenIDConfig provide OpenID Endpoint configuration discovery document
func WithTransport ¶
WithTransport provide custom transport
type Provider ¶
type Provider interface { LoginWithUser(username, password string) error LoginWithClientID(clientID, clientSecret string) error LookupUser(userid string) (User, error) }
Provider implements indentity provider specific admin operations, such as looking up users, fetching additional attributes etc.