Documentation

Overview

    Package upstreamoidc implements an abstraction of upstream OIDC provider interactions.

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    Types

    type ProviderConfig

    type ProviderConfig struct {
    	Name          string
    	UsernameClaim string
    	GroupsClaim   string
    	Config        *oauth2.Config
    	Provider      interface {
    		Verifier(*coreosoidc.Config) *coreosoidc.IDTokenVerifier
    		UserInfo(ctx context.Context, tokenSource oauth2.TokenSource) (*coreosoidc.UserInfo, error)
    	}
    	Client *http.Client
    }

      ProviderConfig holds the active configuration of an upstream OIDC provider.

      func (*ProviderConfig) ExchangeAuthcodeAndValidateTokens

      func (p *ProviderConfig) ExchangeAuthcodeAndValidateTokens(ctx context.Context, authcode string, pkceCodeVerifier pkce.Code, expectedIDTokenNonce nonce.Nonce, redirectURI string) (*oidctypes.Token, error)

      func (*ProviderConfig) GetAuthorizationURL

      func (p *ProviderConfig) GetAuthorizationURL() *url.URL

      func (*ProviderConfig) GetClientID

      func (p *ProviderConfig) GetClientID() string

      func (*ProviderConfig) GetGroupsClaim

      func (p *ProviderConfig) GetGroupsClaim() string

      func (*ProviderConfig) GetName

      func (p *ProviderConfig) GetName() string

      func (*ProviderConfig) GetScopes

      func (p *ProviderConfig) GetScopes() []string

      func (*ProviderConfig) GetUsernameClaim

      func (p *ProviderConfig) GetUsernameClaim() string

      func (*ProviderConfig) ValidateToken

      func (p *ProviderConfig) ValidateToken(ctx context.Context, tok *oauth2.Token, expectedIDTokenNonce nonce.Nonce) (*oidctypes.Token, error)

      Source Files