oidc

package
v0.3.12 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidToken = errors.New("invalid token")
)

Functions

This section is empty.

Types

type ClaimSet

type ClaimSet struct {
	Iss           string `json:"iss"`             // email address of the client_id of the application making the access token request
	Scope         string `json:"scope,omitempty"` // space-delimited list of the permissions the application requests
	Aud           string `json:"aud"`             // descriptor of the intended target of the assertion (Optional).
	Azp           string `json:"azp"`
	Exp           int64  `json:"exp"`           // the expiration time of the assertion (seconds since Unix epoch)
	Iat           int64  `json:"iat"`           // the time the assertion was issued (seconds since Unix epoch)
	Typ           string `json:"typ,omitempty"` // token type (Optional).
	Sub           string `json:"sub,omitempty"` // Email for which the application is requesting delegated access (Optional).
	Email         string `json:"email"`
	EmailVerified bool   `json:"email_verified"`
}

ClaimSet represents claim set

type PasswordGrantTokenSource added in v0.2.9

type PasswordGrantTokenSource struct {
	ClientID string `json:"client_id"`

	ClientSecret string `json:"client_secret"`

	Username string `json:"username"`

	Password string `json:"password"`

	// TokenURL is the resource server's token endpoint
	// URL. This is a constant specific to each server.
	TokenURL string `json:"token_url"`

	// Scope specifies optional requested permissions.
	Scopes []string `json:"scopes"`
}

func NewPasswordGrantTokenSource added in v0.2.9

func NewPasswordGrantTokenSource(credentialsFile string, targetAudience string) (*PasswordGrantTokenSource, error)

func (*PasswordGrantTokenSource) GetIDToken added in v0.2.9

func (s *PasswordGrantTokenSource) GetIDToken(parent context.Context) (string, error)

GetIDToken - retrieve token from endpoint

type ServiceAccountTokenSource

type ServiceAccountTokenSource struct {
	// ClientID is the application's ID.
	ClientID string `json:"client_id"`

	// ClientSecret is the application's secret.
	ClientSecret string `json:"client_secret"`

	// TokenURL is the resource server's token endpoint
	// URL. This is a constant specific to each server.
	TokenURL string `json:"token_url"`

	// Scope specifies optional requested permissions.
	Scopes []string `json:"scopes"`
}

func NewServiceAccountTokenSource

func NewServiceAccountTokenSource(credentialsFile string, targetAudience string) (*ServiceAccountTokenSource, error)

func (*ServiceAccountTokenSource) GetIDToken

func (s *ServiceAccountTokenSource) GetIDToken(parent context.Context) (string, error)

GetIDToken - retrieve token from endpoint

type Token

type Token struct {
	Raw      string
	Header   *jws.Header
	ClaimSet *ClaimSet
}

func ParseJWT

func ParseJWT(token string) (*Token, error)

Jump to

Keyboard shortcuts

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