nroidc

package
v0.0.0-...-261f9d3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigurationPath          = "/.well-known/openid-configuration"
	DefaultAcceptableClockSkew = 5 * time.Minute
	MinimumRefreshInterval     = 15 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorizer

type Authorizer struct {
	WellKnownConfig *WellKnownConfig
	AutoRefresh     *jwk.AutoRefresh
	Audience        string
	Authority       string
}

func NewAuthorizer

func NewAuthorizer(authority string, audience string) (*Authorizer, error)

func (Authorizer) Authorize

func (a Authorizer) Authorize(token string) (*jwt.Token, error)

type TokenEndpointResponse

type TokenEndpointResponse struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	RefreshToken string `json:"refresh_token"`
	ExpiresIn    int    `json:"expires_in"`
	IdToken      string `json:"id_token"`
}

func NewClientCredentialsToken

func NewClientCredentialsToken(authority string, id string, secret string, scopes ...string) (*TokenEndpointResponse, error)

type WellKnownConfig

type WellKnownConfig struct {
	Issuer        string `json:"issuer"`
	JwksUri       string `json:"jwks_uri"`
	TokenEndpoint string `json:"token_endpoint"`
}

func NewWellKnownConfig

func NewWellKnownConfig(authority string) (*WellKnownConfig, error)

Jump to

Keyboard shortcuts

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