Documentation
¶
Index ¶
- type Authenticator
- type TextualInt
- type Token
- func (t Token) GetAudience() (jwt.ClaimStrings, error)
- func (t Token) GetExpirationTime() (*jwt.NumericDate, error)
- func (t Token) GetIssuedAt() (*jwt.NumericDate, error)
- func (t Token) GetIssuer() (string, error)
- func (t Token) GetNotBefore() (*jwt.NumericDate, error)
- func (t Token) GetSubject() (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
func NewAuthenticator ¶
func (*Authenticator) ForceRefreshJWKS ¶
func (auth *Authenticator) ForceRefreshJWKS(ctx context.Context) (err error)
func (*Authenticator) Validate ¶
func (auth *Authenticator) Validate(token string, dst *Token) (err error)
func (*Authenticator) ValidateBytes ¶
func (auth *Authenticator) ValidateBytes(token []byte, dst *Token) (err error)
type TextualInt ¶
type TextualInt int
An integer that encodes to (and decodes from) a JSON string.
func (TextualInt) MarshalJSON ¶
func (t TextualInt) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (TextualInt) String ¶
func (t TextualInt) String() string
func (*TextualInt) UnmarshalJSON ¶
func (t *TextualInt) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Token ¶
type Token struct {
ID uuid.UUID `json:"jti"`
IssuedAt jwt.NumericDate `json:"iat"`
ExpiresAt jwt.NumericDate `json:"exp"`
Issuer string `json:"iss"`
Subject TextualInt `json:"sub"`
AuthContext string `json:"acr"`
FirstName string `json:"given_name"`
LastName string `json:"family_name"`
Actor struct {
Subject TextualInt `json:"sub"`
} `json:"act"`
}
JWT claims with naming according to: https://www.iana.org/assignments/jwt/jwt.xhtml
func (Token) GetAudience ¶
func (t Token) GetAudience() (jwt.ClaimStrings, error)
GetAudience implements jwt.Claims.
func (Token) GetExpirationTime ¶
func (t Token) GetExpirationTime() (*jwt.NumericDate, error)
GetExpirationTime implements jwt.Claims.
func (Token) GetIssuedAt ¶
func (t Token) GetIssuedAt() (*jwt.NumericDate, error)
GetIssuedAt implements jwt.Claims.
func (Token) GetNotBefore ¶
func (t Token) GetNotBefore() (*jwt.NumericDate, error)
GetNotBefore implements jwt.Claims.
func (Token) GetSubject ¶
GetSubject implements jwt.Claims.
Click to show internal directories.
Click to hide internal directories.