token

package
v0.0.0-...-21df278 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	EventID         string   `json:"event_id"`
	Scope           string   `json:"scope"`
	ClientID        string   `json:"client_id"`
	CognitoUserName string   `json:"username"`
	TokenUse        string   `json:"token_use"`
	AuthTime        float64  `json:"auth_time"`
	Groups          []string `json:"cognito:groups"`
	jwt.StandardClaims
}

AccessToken represents the parsed JWT token containing access token

type IDToken

type IDToken struct {
	OrgName         string   `json:"custom:orgname"`
	FirstName       string   `json:"given_name"`
	LastName        string   `json:"family_name"`
	EventID         string   `json:"event_id"`
	Email           string   `json:"email"`
	CognitoUserName string   `json:"cognito:username"`
	TokenUse        string   `json:"token_use"`
	AuthTime        float64  `json:"auth_time"`
	Roles           []string `json:"cognito:roles"`
	Groups          []string `json:"cognito:groups"`
	jwt.StandardClaims
}

IDToken represents the parsed JWT token containing user claims

type Tokener

type Tokener interface {
	// UnsafeExtractDetails extracts claims but does not verify signature
	UnsafeExtractID(ctx context.Context, idKey string) (*IDToken, error)
	// UnsafeExtractAccess extracts claims from the accses token but does not verify signature
	UnsafeExtractAccess(ctx context.Context, accessKey string) (*AccessToken, error)
	// ValidateIDToken actually verifies signature on the token as well as verifies claims are proper
	ValidateIDToken(ctx context.Context, org *am.Organization, idKey string) (*IDToken, error)
	// ValidateAccessToken actually verifies signature on the token as well as verifies claims are proper
	ValidateAccessToken(ctx context.Context, org *am.Organization, accessKey string) (*AccessToken, error)
}

Tokener for extracting details from a cognito jwt token.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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