Documentation ¶
Overview ¶
Package login defines the basic entrypoint required to perform a remote oauth login.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextIdentity ¶
ContextIdentity returns the identity's ID found in given context Uses tokenManager.Locate to fetch the identity of currently logged in user
func InjectTokenManager ¶
func InjectTokenManager(tokenManager token.Manager) goa.Middleware
InjectTokenManager is a middleware responsible for setting up tokenManager in the context for every request.
Types ¶
type KeycloakOAuthProvider ¶
type KeycloakOAuthProvider struct { Identities account.IdentityRepository Users account.UserRepository TokenManager token.Manager // contains filtered or unexported fields }
KeycloakOAuthProvider represents a keycloak IDP
func NewKeycloakOAuthProvider ¶
func NewKeycloakOAuthProvider(identities account.IdentityRepository, users account.UserRepository, tokenManager token.Manager, db application.DB) *KeycloakOAuthProvider
NewKeycloakOAuthProvider creates a new login.Service capable of using keycloak for authorization
func (*KeycloakOAuthProvider) CreateOrUpdateKeycloakUser ¶
func (keycloak *KeycloakOAuthProvider) CreateOrUpdateKeycloakUser(accessToken string, ctx context.Context) (*account.Identity, *account.User, error)
CreateOrUpdateKeycloakUser creates a user and a keycloak identity. If the user and identity already exist then update them.
Directories ¶
Path | Synopsis |
---|---|
Package tokencontext contains the code that extract token manager from the context.
|
Package tokencontext contains the code that extract token manager from the context. |
Click to show internal directories.
Click to hide internal directories.