oidc

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client for oidc

func New

func New(config *Config) (*Client, error)

New returns client instance

func (*Client) CheckRefresh

func (c *Client) CheckRefresh(tok *oauth2.Token) (*oauth2.Token, error)

CheckRefresh refreshes the given token if necessary, returning the original token if not.

func (*Client) CreateOIDCRequest

func (c *Client) CreateOIDCRequest(state, scopeString string) string

CreateOIDCRequest create oidc request

func (*Client) GetIDTokenClaims

func (c *Client) GetIDTokenClaims(reqContext context.Context, code string) ([]byte, error)

GetIDTokenClaims handle oidc callback and get claims from ID token

func (*Client) HandleOIDCCallback

func (c *Client) HandleOIDCCallback(reqContext context.Context, code string) (*oauth2.Token, *oidc.IDToken, error)

HandleOIDCCallback handle oidc callback and returns access token and optional refresh and ID tokens

type Config

type Config struct {
	TLSConfig              *tls.Config
	OIDCProviderURL        string
	OIDCClientID           string
	OIDCClientSecret       string
	OIDCClientSecretExpiry int
	OIDCCallbackURL        string
	// Scopes scopes that oidc.Client is allowed to request.
	Scopes []string
}

Config defines configuration for oidc client

Jump to

Keyboard shortcuts

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