oidc

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2020 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UsingTokenMode

func UsingTokenMode() func(*PrivateKeyJWTAuthenticator)

UsingTokenMode sets tokenMode to true Token mode make the authenticator generating a bearer token for the client performing a concrete client_credentials flow, instead of just embedding private_key_jwt parameter in the body as it is necessary on an exchange token. The token is then used as a Bearer Token (Authorization Header), kept in memory with its expiry time and renewed when necessary.

Types

type Client

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

Client implementing some Open ID Connect concepts as a Relying Party (a.k.a. Third Party).

func NewClient

func NewClient(id, tokenURL, encodedJWK string) (*Client, error)

NewClient configured with a tokenURL and an encoded JWK: a base64 encoded string of the JSON Web Key (the public and private keypair) following https://tools.ietf.org/html/rfc7517 based on this string this constructor instantiates a JWK Signer to be able to sign client information in jwt.

func (*Client) Assert

func (cli *Client) Assert(ctx context.Context) string

Assert claims created on the fly using the jwk signer and oidc client information

func (*Client) ID

func (cli *Client) ID() string

ID returns the immutable client id

type PrivateKeyJWTAuthenticator

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

PrivateKeyJWTAuthenticator allows the Client Authentication using private_key_jwt method: https://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication It has 2 possible mode described below.

func NewPrivateKeyJWTAuthenticator

func NewPrivateKeyJWTAuthenticator(oidcCli *Client, options ...func(*PrivateKeyJWTAuthenticator)) *PrivateKeyJWTAuthenticator

NewPrivateKeyJWTAuthenticator returned, configured with the given OIDCClient

func (*PrivateKeyJWTAuthenticator) Set

func (authenticator *PrivateKeyJWTAuthenticator) Set(ctx context.Context, req *http.Request)

Set client authentication considering used method is OIDC private_key_jwt: https://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication

Jump to

Keyboard shortcuts

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