upstreamoidc

package
v0.36.22 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

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)

Jump to

Keyboard shortcuts

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