Documentation ¶
Index ¶
- func ImportLegacyAddrTokenProvider(c *keycloak.Config) error
- func NewKeycloakURIProvider(entries map[string]string, defaultKey string) (keycloak.KeycloakURIProvider, error)
- func NewKeycloakURIProviderFromArray(uris []string) (keycloak.KeycloakURIProvider, error)
- type DefaultProfileProviderFunc
- type IssuerManager
- type Logger
- type OAuth2Config
- type OidcTokenProvider
- type OidcVerifier
- type OidcVerifierProvider
- type ProfileRetriever
- type UserProfileCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImportLegacyAddrTokenProvider ¶
func ImportLegacyAddrTokenProvider(c *keycloak.Config) error
ImportLegacyAddrTokenProvider
func NewKeycloakURIProvider ¶
func NewKeycloakURIProvider(entries map[string]string, defaultKey string) (keycloak.KeycloakURIProvider, error)
NewKeycloakURIProvider creates a Keycloak URI provider
func NewKeycloakURIProviderFromArray ¶
NewKeycloakURIProviderFromArray creates a Keycloak URI provider
Types ¶
type DefaultProfileProviderFunc ¶ added in v2.6.1
DefaultProfileProviderFunc function type
type IssuerManager ¶
type IssuerManager interface {
GetOidcVerifierProvider(issuer string) (OidcVerifierProvider, error)
}
IssuerManager provides URL according to a given context
func NewIssuerManager ¶
func NewIssuerManager(config keycloak.Config) (IssuerManager, error)
NewIssuerManager creates a new URLProvider
type OAuth2Config ¶ added in v2.7.0
type OAuth2Config struct { Realm *string `mapstructure:"realm"` Username *string `mapstructure:"username"` Password *string `mapstructure:"password"` ClientID *string `mapstructure:"client-id"` ClientSecret *string `mapstructure:"client-secret"` }
OAuth2Config struct
func (*OAuth2Config) IsClientConfig ¶ added in v2.7.0
func (oac *OAuth2Config) IsClientConfig() bool
IsClientConfig checks if the config is a client config or a username/password one
type OidcTokenProvider ¶
type OidcTokenProvider interface { ProvideToken(ctx context.Context) (string, error) ProvideTokenForRealm(ctx context.Context, realm string) (string, error) }
OidcTokenProvider provides OIDC tokens
func NewOAuth2TokenProvider ¶ added in v2.7.0
func NewOAuth2TokenProvider(kcConfig keycloak.Config, oauth2Config OAuth2Config, logger Logger) OidcTokenProvider
NewOAuth2TokenProvider creates an OidcTokenProvider
func NewOidcTokenProvider ¶
func NewOidcTokenProvider(config keycloak.Config, realm, username, password, clientID string, logger Logger) OidcTokenProvider
NewOidcTokenProvider creates an OidcTokenProvider
type OidcVerifier ¶
OidcVerifier is an interface for OIDC token verifiers
type OidcVerifierProvider ¶
type OidcVerifierProvider interface {
GetOidcVerifier(realm string) (OidcVerifier, error)
}
OidcVerifierProvider is an interface for a provider of OidcVerifier instances
func NewVerifierCache ¶
func NewVerifierCache(tokenURL *url.URL) OidcVerifierProvider
NewVerifierCache create an instance of OIDC verifier cache
type ProfileRetriever ¶ added in v2.6.1
type ProfileRetriever interface { GetRealm(accessToken string, realmName string) (keycloak.RealmRepresentation, error) GetUserProfile(accessToken string, realmName string) (keycloak.UserProfileRepresentation, error) }
ProfileRetriever interface
type UserProfileCache ¶ added in v2.6.1
type UserProfileCache struct {
// contains filtered or unexported fields
}
UserProfileCache struct
func NewUserProfileCache ¶ added in v2.6.1
func NewUserProfileCache(retriever ProfileRetriever, tokenProvider OidcTokenProvider, defProfileProvider DefaultProfileProviderFunc) *UserProfileCache
func (*UserProfileCache) GetRealmUserProfile ¶ added in v2.6.1
func (upc *UserProfileCache) GetRealmUserProfile(ctx context.Context, realmName string) (keycloak.UserProfileRepresentation, error)
GetRealmUserProfile gets the realm users profile using the token provider provided when creating the UserProfileCache instance
func (*UserProfileCache) GetRealmUserProfileWithToken ¶ added in v2.6.1
func (upc *UserProfileCache) GetRealmUserProfileWithToken(accessToken string, realmName string) (keycloak.UserProfileRepresentation, error)
GetRealmUserProfileWithToken gets the realm users profile using the provided access token