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 ¶
ContextIdentity returns the identity's ID found in given context Uses tokenManager.Locate to fetch the identity of currently logged in user
func ContextWithTokenManager ¶
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.
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
Click to show internal directories.
Click to hide internal directories.