Documentation
¶
Overview ¶
Package jwt provides JWT token signing.
Index ¶
Constants ¶
View Source
const ( // ScopeAccess is a full access token. ScopeAccess = "access" // ScopeRefresh is required to receive a new access token. ScopeRefresh = "refresh" // Scope2FAPending is used for JWTs that are issued during the login // process when the second authentication factor is still pending. Scope2FAPending = "2fa-pending" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppMetadata ¶
type AppMetadata struct { TokenVersion string `json:"token_version" xml:"token_version" yaml:"token_version"` ParentTokenID string `json:"parent_token" xml:"parent_token" yaml:"parent_token"` Authorization *Authorization `json:"authorization,omitempty" xml:"authorization" yaml:"authorization,omitempty"` LoginKind string `json:"loginKind,omitempty"` }
AppMetadata defines app specific metadata attached to JWT tokens issued by cisd.
type Authorization ¶
type Authorization struct {
Roles []string `json:"roles,omitempty" xml:"roles" yaml:"roles,omitempty"`
}
Authorization contains app related authorization and permission settings.
type Claims ¶
type Claims struct { Audience string `json:"aud,omitempty" xml:"aud" yaml:"aud,omitempty"` ExpiresAt int64 `json:"exp,omitempty" xml:"exp" yaml:"exp,omitempty"` ID string `json:"jti,omitempty" xml:"jti" yaml:"jti,omitempty"` IssuedAt int64 `json:"iat,omitempty" xml:"iat" yaml:"iat,omitempty"` Issuer string `json:"iss,omitempty" xml:"iss" yaml:"iss,omitempty"` NotBefore int64 `json:"nbf,omitempty" xml:"nbf" yaml:"nbf,omitempty"` Subject string `json:"sub,omitempty" xml:"sub" yaml:"sub,omitempty"` Name string `json:"name,omitempty" xml:"name" yaml:"name,omitempty"` DisplayName string `json:"displayName,omitempty" xml:"displayName" yaml:"displayName"` Scopes []Scope `json:"scopes,omitempty" xml:"scopes" yaml:"scopes,omitempty"` Email string `json:"email,omitempty" xml:"email" yaml:"email,omitempty"` AppMetadata *AppMetadata `json:"app_metadata,omitempty" xml:"app_metadata" yaml:"app_metadata,omitempty"` }
Claims represents the claims added to a JWT token issued by cisd.
func ParseAndVerify ¶
ParseAndVerify parses the JWT token and verifies it's signature.
Click to show internal directories.
Click to hide internal directories.