Documentation ¶
Index ¶
- Variables
- func TokenHash(token string) string
- type AccessTokenClaims
- type AuthorizedParties
- type CodeClaims
- type ExtraClaims
- type IDTokenClaims
- type JWK
- type Manager
- func (m Manager) CreateAccessToken(issuer *config.URL, subject, clientID, 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) CreateRefreshToken(issuer *config.URL, subject, clientID, scope, nonce string, authTime time.Time, ...) (string, error)
- func (m Manager) CreateRequestObject(issuer *config.URL, subject string, request RequestObjectClaims, ...) (string, error)
- func (m Manager) CreateSSOToken(issuer *config.URL, subject string, authorized AuthorizedParties, ...) (string, error)
- func (m Manager) JWKs(hostname string) ([]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) ParseRefreshToken(token string) (RefreshTokenClaims, error)
- func (m Manager) ParseRequestObject(token string, signKey string) (RequestObjectClaims, error)
- func (m Manager) ParseSSOToken(token string) (SSOTokenClaims, error)
- func (m Manager) PublicKey() *rsa.PublicKey
- type OIDCClaims
- type RefreshTokenClaims
- type RequestObjectClaims
- type SSOTokenClaims
Constants ¶
This section is empty.
Variables ¶
View Source
var ( InvalidTokenError = errors.New("invalid token") TokenExpiredError = errors.New("token has already expired") UnexpectedIssuerError = errors.New("unexpected issuer") UnexpectedAudienceError = errors.New("unexpected audience") UnexpectedTokenTypeError = errors.New("unexpected token type") UnexpectedClientIDError = errors.New("unexpected client_id") )
View Source
var (
NotJWEError = errors.New("not a valid JWE data")
)
Functions ¶
Types ¶
type AccessTokenClaims ¶
type AccessTokenClaims struct { OIDCClaims AuthorizedParties []string `json:"azp,omitempty"` Scope string `json:"scope,omitempty"` }
type AuthorizedParties ¶ added in v0.4.0
type AuthorizedParties []string
func (AuthorizedParties) Append ¶ added in v0.4.0
func (azp AuthorizedParties) Append(rp string) AuthorizedParties
func (AuthorizedParties) Includes ¶ added in v0.4.0
func (azp AuthorizedParties) Includes(rp string) bool
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 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) CreateRefreshToken ¶
func (Manager) CreateRequestObject ¶ added in v0.5.0
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) ParseRefreshToken ¶
func (m Manager) ParseRefreshToken(token string) (RefreshTokenClaims, error)
func (Manager) ParseRequestObject ¶ added in v0.5.0
func (m Manager) ParseRequestObject(token string, signKey string) (RequestObjectClaims, error)
func (Manager) ParseSSOToken ¶ added in v0.4.0
func (m Manager) ParseSSOToken(token string) (SSOTokenClaims, error)
type OIDCClaims ¶
type RefreshTokenClaims ¶
type RefreshTokenClaims struct { OIDCClaims ClientID string `json:"client_id"` Scope string `json:"scope,omitempty"` Nonce string `json:"nonce,omitempty"` }
type RequestObjectClaims ¶ added in v0.5.0
type RequestObjectClaims struct { jwt.StandardClaims ResponseType string `json:"response_type,omitempty"` ClientID string `json:"client_id,omitempty"` RedirectURI string `json:"redirect_uri,omitempty"` Scope string `json:"scope,omitempty"` State string `json:"state,omitempty"` Nonce string `json:"nonce,omitempty"` MaxAge int64 `json:"max_age,omitempty"` Prompt string `json:"prompt,omitempty"` LoginHint string `json:"login_hint,omitempty"` }
type SSOTokenClaims ¶ added in v0.4.0
type SSOTokenClaims struct { OIDCClaims Authorized AuthorizedParties `json:"azp,omitempty"` }
Click to show internal directories.
Click to hide internal directories.