login

package
v0.0.0-...-ef83997 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

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

func ContextIdentity(ctx context.Context) (*uuid.UUID, error)

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.

type KeycloakOAuthService

type KeycloakOAuthService interface {
	CreateOrUpdateKeycloakUser(accessToken string, ctx context.Context) (*account.Identity, *account.User, error)
}

KeycloakOAuthService represents keycloak OAuth service interface

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL