Documentation ¶
Index ¶
- Variables
- func TokenHash(token string) string
- type AccessTokenClaims
- type CodeClaims
- type ExtraClaims
- type IDTokenClaims
- type JWK
- type LoginTokenClaims
- type Manager
- func (m Manager) CreateAccessToken(issuer *config.URL, subject, scope string, authTime time.Time, ...) (string, error)
- func (m Manager) CreateCode(issuer *config.URL, subject, clientID, redirectURI, scope, nonce string, ...) (string, error)
- func (m Manager) CreateIDToken(issuer *config.URL, subject, audience, nonce, code, accessToken string, ...) (string, error)
- func (m Manager) CreateLoginToken(issuer *config.URL, subject, clientID string, expiresIn time.Duration) (string, error)
- func (m Manager) CreateRefreshToken(issuer *config.URL, subject, clientID, scope, nonce string, authTime time.Time, ...) (string, error)
- func (m Manager) CreateSSOToken(issuer *config.URL, subject string, authTime time.Time, ...) (string, error)
- func (m Manager) JWKs() ([]JWK, error)
- func (m Manager) KeyID() uuid.UUID
- func (m Manager) ParseAccessToken(token string) (AccessTokenClaims, error)
- func (m Manager) ParseCode(token string) (CodeClaims, error)
- func (m Manager) ParseIDToken(token string) (IDTokenClaims, error)
- func (m Manager) ParseLoginToken(token string) (LoginTokenClaims, error)
- func (m Manager) ParseRefreshToken(token string) (RefreshTokenClaims, error)
- func (m Manager) PublicKey() *rsa.PublicKey
- type OIDCClaims
- type RefreshTokenClaims
Constants ¶
This section is empty.
Variables ¶
View Source
var ( InvalidTokenError = fmt.Errorf("invalid token") UnexpectedIssuerError = fmt.Errorf("unexpected issuer") UnexpectedAudienceError = fmt.Errorf("unexpected audience") UnexpectedTokenTypeError = fmt.Errorf("unexpected token type") UnexpectedClientIDError = fmt.Errorf("unexpected client_id") )
View Source
var (
NotJWEError = errors.New("not a valid JWE data")
)
Functions ¶
Types ¶
type AccessTokenClaims ¶
type AccessTokenClaims struct { OIDCClaims Scope string `json:"scope,omitempty"` }
type CodeClaims ¶
type CodeClaims struct { OIDCClaims ClientID string `json:"client_id"` RedirectURI string `json:"redirect_uri"` Nonce string `json:"nonce,omitempty"` Scope string `json:"scope,omitempty"` }
type ExtraClaims ¶
type ExtraClaims map[string]interface{}
type IDTokenClaims ¶
type IDTokenClaims struct { OIDCClaims Nonce string `json:"nonce,omitempty"` CodeHash string `json:"c_hash,omitempty"` AccessTokenHash string `json:"at_hash,omitempty"` ExtraClaims ExtraClaims `json:"-"` }
func (IDTokenClaims) MarshalJSON ¶
func (claims IDTokenClaims) MarshalJSON() ([]byte, error)
func (*IDTokenClaims) UnmarshalJSON ¶
func (claims *IDTokenClaims) UnmarshalJSON(data []byte) error
type LoginTokenClaims ¶
type LoginTokenClaims struct { OIDCClaims ClientID string `json:"client_id"` }
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func GenerateManager ¶
func NewManager ¶
func NewManager(private *rsa.PrivateKey) (Manager, error)
func (Manager) CreateAccessToken ¶
func (Manager) CreateCode ¶
func (Manager) CreateIDToken ¶
func (Manager) CreateLoginToken ¶
func (Manager) CreateRefreshToken ¶
func (Manager) CreateSSOToken ¶
func (Manager) ParseAccessToken ¶
func (m Manager) ParseAccessToken(token string) (AccessTokenClaims, error)
func (Manager) ParseIDToken ¶
func (m Manager) ParseIDToken(token string) (IDTokenClaims, error)
func (Manager) ParseLoginToken ¶
func (m Manager) ParseLoginToken(token string) (LoginTokenClaims, error)
func (Manager) ParseRefreshToken ¶
func (m Manager) ParseRefreshToken(token string) (RefreshTokenClaims, error)
type OIDCClaims ¶
type RefreshTokenClaims ¶
type RefreshTokenClaims struct { OIDCClaims ClientID string `json:"client_id"` Scope string `json:"scope,omitempty"` Nonce string `json:"nonce,omitempty"` }
Click to show internal directories.
Click to hide internal directories.