oidc

package
v0.0.0-...-95977df Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: EUPL-1.2 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthnClientSession

type AuthnClientSession struct {
	ID            string                 `json:"id"`
	Issuer        string                 `json:"issuer"`
	State         string                 `json:"state"`
	Nonce         string                 `json:"nonce"`
	Verifier      string                 `json:"verifier"`
	RedirectURI   string                 `json:"redirect_uri"`
	AuthURL       string                 `json:"auth_url"`
	TokenResponse *oauth2.TokenResponse  `json:"token_response"`
	Claims        map[string]interface{} `json:"claims"`
}

type AuthnClientSessionStore

type AuthnClientSessionStore interface {
	GetAuthnClientSessionByID(id string) (*AuthnClientSession, error)
	GetAuthnClientSessionByState(state string) (*AuthnClientSession, error)
	SaveAuthnClientSession(session *AuthnClientSession) error
	DeleteAuthnClientSession(state string) error
}

type Client

type Client interface {
	oauth2.Client
	ParseIDToken(response *oauth2.TokenResponse) (jwt.Token, error)
	Issuer() string
	ClientID() string
	Name() string
	LogoURI() string
}

func NewClient

func NewClient(cfg Config) (Client, error)

type Config

type Config struct {
	Issuer       string   `yaml:"issuer" validate:"required"`
	ClientID     string   `yaml:"client_id"`
	ClientSecret string   `yaml:"client_secret"`
	RedirectURI  string   `yaml:"redirect_uri"`
	Scopes       []string `yaml:"scopes"`
	LogoURI      string   `yaml:"logo_uri"`
	Name         string   `yaml:"name"`
}

type DiscoveryDocument

type DiscoveryDocument struct {
	Issuer                           string   `json:"issuer"`
	AuthorizationEndpoint            string   `json:"authorization_endpoint"`
	TokenEndpoint                    string   `json:"token_endpoint"`
	JwksURI                          string   `json:"jwks_uri"`
	UserinfoEndpoint                 string   `json:"userinfo_endpoint"`
	RevocationEndpoint               string   `json:"revocation_endpoint"`
	ResponseTypesSupported           []string `json:"response_types_supported"`
	IdTokenSigningAlgValuesSupported []string `json:"id_token_signing_alg_values_supported"`
}

func FetchDiscoveryDocument

func FetchDiscoveryDocument(url string) (*DiscoveryDocument, error)

type OpenidProviderInfo

type OpenidProviderInfo struct {
	Issuer  string `json:"iss"`
	LogoURI string `json:"logo_uri"`
	Name    string `json:"name"`
	Type    string `json:"type"`
}

OpenidProviderInfo represents the information about an OpenID Provider

Jump to

Keyboard shortcuts

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