oidc

package
v0.0.0-...-e5c9b1b Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultProvider = NewProvider()

Functions

func DetectJWT

func DetectJWT(r *http.Request) (string, error)

Types

type ClientConfig

type ClientConfig struct {
	Issuer   string
	ClientID string
}

type DiscoveryClient

type DiscoveryClient struct {
	Cache *OIDCCache
	// contains filtered or unexported fields
}

func NewDiscoveryClient

func NewDiscoveryClient() *DiscoveryClient

func (*DiscoveryClient) GetDiscoveryRoot

func (dc *DiscoveryClient) GetDiscoveryRoot(issuer string) (*DiscoveryResponse, error)

func (*DiscoveryClient) GetJWKs

func (dc *DiscoveryClient) GetJWKs(issuer string) (jwk.Set, error)

type DiscoveryResponse

type DiscoveryResponse struct {
	Issuer                string `json:"issuer"`
	AuthorizationEndpoint string `json:"authorization_endpoint"`
	TokenEndpoint         string `json:"token_endpoint"`
	JwksUri               string `json:"jwks_uri"`
}

type OIDCCache

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

func NewOIDCCache

func NewOIDCCache() *OIDCCache

func (*OIDCCache) GetKeys

func (dc *OIDCCache) GetKeys(issuer string) jwk.Set

func (*OIDCCache) GetResponse

func (dc *OIDCCache) GetResponse(issuer string) *DiscoveryResponse

func (*OIDCCache) StoreKeys

func (dc *OIDCCache) StoreKeys(issuer string, set jwk.Set)

func (*OIDCCache) StoreResponse

func (dc *OIDCCache) StoreResponse(response DiscoveryResponse)

type Provider

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

func NewProvider

func NewProvider() *Provider

func (*Provider) VerifyToken

func (p *Provider) VerifyToken(tokenString string, issuer string, options ...jwt.ParseOption) (jwt.Token, error)

type ProviderInterface

type ProviderInterface interface {
	VerifyToken(tokenString string, issuer string, options ...jwt.ParseOption) (jwt.Token, error)
}

Jump to

Keyboard shortcuts

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