Documentation ¶
Index ¶
Constants ¶
View Source
const ( IsAccessTokenClaim = "kc.isAccessToken" AuthorizedScopesClaim = "kc.authorizedScopes" IsRefreshTokenClaim = "kc.isRefreshToken" RefClaim = "kc.ref" IdentityClaim = "kc.identity" )
Access token claims used by Konnect.
View Source
const ( IdentifiedUsernameClaim = "kc.i.un" IdentifiedDisplayNameClaim = "kc.i.dn" )
Identifier claims used by Konnect.
View Source
const (
// ScopeID is the string value for the Konnect ID scope.
ScopeID = "konnect/id"
)
Variables ¶
This section is empty.
Functions ¶
func FromClaimsContext ¶
FromClaimsContext returns the AuthRecord value stored in ctx, if any.
Types ¶
type AccessTokenClaims ¶
type AccessTokenClaims struct { IsAccessToken bool `json:"kc.isAccessToken"` AuthorizedScopesList []string `json:"kc.authorizedScopes"` jwt.StandardClaims IdentityClaims jwt.MapClaims `json:"kc.identity"` }
AccessTokenClaims define the claims found in access tokens issued by Konnect.
func (AccessTokenClaims) AuthorizedScopes ¶
func (c AccessTokenClaims) AuthorizedScopes() map[string]bool
AuthorizedScopes returns a map with scope keys and true value of all scopes set in the accociated access token.
func (AccessTokenClaims) Valid ¶
func (c AccessTokenClaims) Valid() error
Valid implements the jwt.Claims interface.
type RefreshTokenClaims ¶
type RefreshTokenClaims struct { IsRefreshToken bool `json:"kc.isRefreshToken"` ApprovedScopesList []string `json:"kc.approvedScopes"` Ref string `json:"kc.ref"` jwt.StandardClaims IdentityClaims jwt.MapClaims `json:"kc.identity"` }
RefreshTokenClaims define the claims used by refresh tokens.
func (RefreshTokenClaims) Valid ¶
func (c RefreshTokenClaims) Valid() error
Valid implements the jwt.Claims interface.
type UserInfoResponse ¶
type UserInfoResponse struct { *payload.UserInfoResponse // Note(longsleep): Additional response data for compatibility. ID int64 `json:"id,omitempty"` Username string `json:"username,omitempty"` }
UserInfoResponse defines the data returned from the Konnect UserInfo endpoint. It is the standard ODIC response, extended with additional fields.
Click to show internal directories.
Click to hide internal directories.