session

package
v0.0.0-...-2469478 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IDClaims

type IDClaims struct {
	ID string `json:"jti,omitempty"`

	Issuer    string           `json:"iss,omitempty"`
	Subject   string           `json:"sub,omitempty"`
	Audience  jwt.Audience     `json:"aud,omitempty"`
	Expiry    *jwt.NumericDate `json:"exp,omitempty"`
	NotBefore *jwt.NumericDate `json:"nbf,omitempty"`
	IssuedAt  *jwt.NumericDate `json:"iat,omitempty"`

	Nonce           string `json:"nonce,omitempty"`
	AccessTokenHash string `json:"at_hash,omitempty"`

	Email         string `json:"email,omitempty"`
	EmailVerified bool   `json:"email_verified,omitempty"`

	Name       string           `json:"name,omitempty"`
	GivenName  string           `json:"given_name,omitempty"`
	FamilyName string           `json:"family_name,omitempty"`
	UpdatedAt  *jwt.NumericDate `json:"updated_at,omitempty"`

	// Not a default claim in the standards, but used by Auth0
	// and others.
	OrgID string `json:"org_id,omitempty"`
}

type Token

type Token struct {
	oauth2.Token // Embed an oauth2 token

	Issuer string            `json:"issuer,omitempty"`
	Keys   []jose.JSONWebKey `json:"keys,omitempty"`

	// The id token is technically contained in the original oauth2.Token (inside
	// of extras). However, the extras don't get serialized to JSON, so the id token
	// is lost if we save the token to disk and read it back. We copy the IDToken
	// into this field so that it does get serialized properly.
	IDToken string `json:"id_token,omitempty"`
	// contains filtered or unexported fields
}

func FromOauth2

func FromOauth2(otok *oauth2.Token) (*Token, error)

func (*Token) IDClaims

func (t *Token) IDClaims() *IDClaims

func (*Token) Verify

func (t *Token) Verify() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL