Documentation
¶
Overview ¶
Package oauth exposes function to forge and validate JWT tokens
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Config oauthmodel.Config UserRepository oauthmodel.UserRepository Now = time.Now )
Functions ¶
func Authenticate ¶
func Authenticate(tokenString string) (oauthmodel.Authentication, oauthmodel.Identity, error)
Authenticate verifies JWT and create an access token to use with DPhoto APIs
func Authorise ¶
func Authorise(tokenString string, queryPt *AuthoriseQuery) (*oauthmodel.Claims, error)
Authorise tests the validity of the JWT token (signature and issuer), and the presence of the scopes.
func IsInvalidTokenError ¶
IsInvalidTokenError returns true if authenticated failed because of an invalid token.
func IsNotPreregisteredError ¶
IsNotPreregisteredError returns true when authentication failed because user is not pre-registered
Types ¶
type AuthoriseQuery ¶
func NewAuthoriseQuery ¶
func NewAuthoriseQuery(scopes ...string) *AuthoriseQuery
func (*AuthoriseQuery) WithOwner ¶
func (q *AuthoriseQuery) WithOwner(owner string, permission string) *AuthoriseQuery
Click to show internal directories.
Click to hide internal directories.