oidc

package
v0.0.0-...-be2ef80 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TokenFromIDToken

func TokenFromIDToken(idToken *oidc.IDToken, rawIDToken, refreshToken string) (*oauth2.Token, error)

TokenFromIDToken creates a synthetic oauth2.Token instance with which the standard TokenSource implementation can be used (for handing refresh).

Types

type Client

type Client interface {
	TokenSource(context.Context, *oauth2.Token) oauth2.TokenSource
	AuthCodeURL(string, ...oauth2.AuthCodeOption) string
	Exchange(context.Context, string) (*oauth2.Token, error)
	Verify(context.Context, string) (*oidc.IDToken, error)
	RefreshTokenValidator(string) (*http.Response, error)
	Client() *http.Client
}

Client captures the pieces we care about of *oauth2.Config

func New

func New(cfg Config, retrySec int, certs *certs.ServiceCerts, l OIDCLogger) (Client, error)

New initializes an OIDC client for our purposes

type Config

type Config struct {
	ClientID     string
	ClientSecret string
	RedirectURL  *url.URL
	IssuerURL    *url.URL
	DexURL       *url.URL
}

Config contains necessary elements for initializing OIDC client

type OIDCLogger

type OIDCLogger interface {
	Warn(...interface{})
}

OIDCLogger captures this package's logging needs

Jump to

Keyboard shortcuts

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