login

package
v0.0.0-...-adf365b Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InvalidCodeError could occure when the OAuth Exchange with GitHub return no valid AccessToken
	InvalidCodeError string = "Invalid OAuth2.0 code"
	// PrimaryEmailNotFoundError could occure if no primary email was returned by GitHub
	PrimaryEmailNotFoundError string = "Primary email not found"
)

Variables

This section is empty.

Functions

func ContextIdentity

func ContextIdentity(ctx context.Context) (string, error)

ContextIdentity returns the identity's ID found in given context Uses tokenManager.Locate to fetch the identity of currently logged in user

func ContextWithTokenManager

func ContextWithTokenManager(ctx context.Context, tm token.Manager) context.Context

ContextWithTokenManager injects tokenManager in the context for every incoming request Accepts Token.Manager in order to make sure that correct object is set in the context. Only other possible value is nil

func InjectTokenManager

func InjectTokenManager(tokenManager token.Manager) goa.Middleware

InjectTokenManager is a middleware responsible for setting up tokenManager in the context for every request.

func ReadTokenManagerFromContext

func ReadTokenManagerFromContext(ctx context.Context) token.Manager

ReadTokenManagerFromContext returns tokenManager from context. Must have been set by ContextWithTokenManager ONLY

Types

type Service

type Service interface {
	Perform(ctx *app.AuthorizeLoginContext) error
}

Service defines the basic entrypoint required to perform a remote oauth login

func NewGitHubOAuth

func NewGitHubOAuth(config *oauth2.Config, identities account.IdentityRepository, users account.UserRepository, tokenManager token.Manager) Service

NewGitHubOAuth creates a new login.Service capable of using GitHub for authorization

Jump to

Keyboard shortcuts

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