oidc

package
v2.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWellKnownConfig

func GetWellKnownConfig(issuerURL string) (*oauth2.Endpoint, error)

GetWellKnownConfig constructs a request to return the OIDC well-known config

Types

type Client

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

Client contains the details for a OIDC client

func New

func New(config oauth2.Config, serverApplicationID string) *Client

New returns a new OIDC client

func (*Client) AuthWithDeviceFlow

func (c *Client) AuthWithDeviceFlow(ctx context.Context, loginTimeout time.Duration) (*oauth2.Token, error)

AuthWithDeviceFlow attempts to authorise using the device code oAuth flow.

func (*Client) AuthWithOIDCCallback

func (c *Client) AuthWithOIDCCallback(ctx context.Context, loginTimeout time.Duration, disableBrowserPopup bool) (*oauth2.Token, error)

AuthWithOIDCCallback attempts to authorise using a local callback

func (*Client) Authenticated

func (c *Client) Authenticated() bool

Authenticated returns a true or false value if a given OIDC client has received a successful login

type DeviceFlowAuth

type DeviceFlowAuth struct {
	UserCode        string `json:"user_code" yaml:"user-code"`
	DeviceCode      string `json:"device_code"`
	VerificationURI string `json:"verification_uri,verification_url"`
	Message         string `json:"message"`
	ExpiresIn       int    `json:"expires_in,omitempty"`
	Interval        int    `json:"interval,omitempty"`
}

DeviceFlowAuth contains the response for a device code oAuth flow.

Jump to

Keyboard shortcuts

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