oidc

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2018 License: Apache-2.0, BSD-3-Clause, MIT Imports: 10 Imported by: 0

Documentation

Overview

Package oidc contains logic for setting up an Open ID Connect authenticator

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator struct {
	Verifier security.TokenVerifier
}

Authenticator is the OpenID implementation of security.Authenticator

func NewAuthenticator

func NewAuthenticator(ctx context.Context, options *Options) (*Authenticator, error)

NewAuthenticator returns a new OpenID authenticator or an error if one couldn't be configured

func (*Authenticator) Authenticate

func (a *Authenticator) Authenticate(request *http.Request) (*web.User, security.AuthenticationDecision, error)

Authenticate returns information about the user by obtaining it from the bearer token, or an error if security is unsuccessful

type Options

type Options struct {
	// IssuerURL is the base URL of the token issuer
	IssuerURL string

	// ClientID is the id of the oauth client used to verify the tokens
	ClientID string

	// ReadConfigurationFunc is the function used to call the token issuer. If one is not provided, http.DefaultClient.Do will be used
	ReadConfigurationFunc util.DoRequestFunc
}

Options is the configuration used to construct a new OIDC authenticator

Jump to

Keyboard shortcuts

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