auth

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthClient

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

func NewClient

func NewClient(ctx context.Context, opts Opts) (*AuthClient, error)

NewClient creates a new authentication client. The context on the client should be long-lived, e.g. context.Background().

func (*AuthClient) Config

func (c *AuthClient) Config() *Config

func (*AuthClient) Discover

func (c *AuthClient) Discover(ctx context.Context) (*Config, error)

func (*AuthClient) Token

func (c *AuthClient) Token() (*oauth2.Token, error)

Token retrieves a new oauth2 Token from the endpoint.

It is compatible with the TokenSource interface from the x/oauth2 library.

type Config

type Config struct {
	Issuer                 string   `json:"issuer"`
	TokenEndpoint          string   `json:"token_endpoint"`
	GrantTypesSupported    []string `json:"grant_types_supported"`
	ResponseTypesSupported []string `json:"response_types_supported"`
}

type Opts

type Opts struct {
	LicenceKey     string
	DeploymentName string
	Issuer         string
	BaseClient     *http.Client
}

Jump to

Keyboard shortcuts

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