oidc

package
v0.0.0-...-b302b47 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SigningKeyKid = "oidc-signing-key"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationRequest

type AuthenticationRequest struct {
	Scope        string
	ResponseType string
	ClientID     string
	RedirectUri  string
	Nonce        string
}

type Client

type Client struct {
	Id          string
	Name        string
	RedirectUri string
}

type Config

type Config struct {
	BaseUrl  string
	Clients  []Client
	Keychain *keychain.Keychain
}

type IDTokenPayload

type IDTokenPayload struct {
	Issuer     string `json:"iss"`
	Subject    string `json:"sub"`
	Audience   string `json:"aud"`
	Expiration int64  `json:"exp"`
	IssuedAt   int64  `json:"iat"`
	Nonce      string `json:"nonce"`
	Name       string `json:"name"`
	Role       string `json:"role"`
}

type Oidc

type Oidc struct {
	// contains filtered or unexported fields
}

func New

func New(config Config) (*Oidc, error)

func (*Oidc) GenerateIDToken

func (o *Oidc) GenerateIDToken(user user.UserInfo, clientID string, nonce string) (string, error)

func (*Oidc) GetOpenIDProviderMetadata

func (o *Oidc) GetOpenIDProviderMetadata() OpenIDProviderMetadata

func (*Oidc) GetPublicKeys

func (o *Oidc) GetPublicKeys() []jose.JSONWebKey

func (*Oidc) ValidateAuthenticationRequest

func (o *Oidc) ValidateAuthenticationRequest(req AuthenticationRequest) error

type OpenIDProviderMetadata

type OpenIDProviderMetadata struct {
	Issuer                           string   `json:"issuer"`
	AuthorizationEndpoint            string   `json:"authorization_endpoint"`
	JWKsUri                          string   `json:"jwks_uri"`
	ResponseTypesSupported           []string `json:"response_types_supported"`
	SubjectTypesSupported            []string `json:"subject_types_supported"`
	IdTokenSigningAlgValuesSupported []string `json:"id_token_signing_alg_values_supported"`
}

Jump to

Keyboard shortcuts

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