Documentation
¶
Index ¶
- type Auth0AccessTokenResponse
- type Auth0Role
- type Auth0RoleRequest
- type Auth0UserRoleRequest
- type Authenticator
- func (a *Authenticator) AssignRoleToUser(ctx context.Context, accessToken, userID, roleName string) error
- func (a *Authenticator) CreateRole(ctx context.Context, accessToken, roleName string) (string, error)
- func (a *Authenticator) GetAuth0AccessToken(ctx context.Context) (string, error)
- func (a *Authenticator) GetAuth0Roles(ctx context.Context, accessToken string) ([]Auth0Role, error)
- func (a *Authenticator) GetUserRoles(ctx context.Context, accessToken, userID string) ([]string, error)
- func (a *Authenticator) Init(ctx context.Context) error
- func (a *Authenticator) VerifyIDToken(ctx context.Context, token *oauth2.Token) (*oidc.IDToken, error)
- type DI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth0AccessTokenResponse ¶
type Auth0AccessTokenResponse struct { AccessToken string `json:"access_token"` ExpiresIn int `json:"expires_in"` TokenType string `json:"token_type"` RefreshToken string `json:"refresh_token"` }
Auth0AccessTokenResponse represents the response from Auth0 access token authorization
type Auth0RoleRequest ¶
type Auth0RoleRequest struct {
Name string `json:"name"`
}
Auth0RoleRequest represents the Auth0Role request
type Auth0UserRoleRequest ¶
type Auth0UserRoleRequest struct {
Roles []string `json:"roles"`
}
Auth0UserRoleRequest represents the Auth0UserRole request
type Authenticator ¶
type Authenticator struct { *oidc.Provider oauth2.Config // contains filtered or unexported fields }
Authenticator is used to authenticate our users.
func (*Authenticator) AssignRoleToUser ¶
func (a *Authenticator) AssignRoleToUser(ctx context.Context, accessToken, userID, roleName string) error
AssignRoleToUser assigns the given user to the given role
func (*Authenticator) CreateRole ¶
func (a *Authenticator) CreateRole(ctx context.Context, accessToken, roleName string) (string, error)
CreateRole creates a new role to the list
func (*Authenticator) GetAuth0AccessToken ¶
func (a *Authenticator) GetAuth0AccessToken(ctx context.Context) (string, error)
GetAuth0AccessToken fetches auth0 access token from the server
func (*Authenticator) GetAuth0Roles ¶
GetAuth0Roles fetches all the auth0 roles
func (*Authenticator) GetUserRoles ¶
func (a *Authenticator) GetUserRoles(ctx context.Context, accessToken, userID string) ([]string, error)
GetUserRoles fetches user roles from oauth0
func (*Authenticator) Init ¶
func (a *Authenticator) Init(ctx context.Context) error
Init checks the roles available in the auth0 namespace
func (*Authenticator) VerifyIDToken ¶
func (a *Authenticator) VerifyIDToken(ctx context.Context, token *oauth2.Token) (*oidc.IDToken, error)
VerifyIDToken verifies that an *oauth2.Token is a valid *oidc.IDToken.
Click to show internal directories.
Click to hide internal directories.