authcode

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 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 Browser

type Browser struct {
	// Logger holds a logging instance
	Logger logger.Logger
}

Browser represents a browser based login

func (*Browser) Login

func (b *Browser) Login(ctx context.Context, in *BrowserLoginInput, oidcClient oidc.Client) (*oidc.TokenSet, error)

Login performs browser based autocode flow, i.e.: 1. Starting a http server that response to the redirect url request 2. Opening a browser that performs login and redirects to the redirect url 3. Validates the token

type BrowserLoginInput

type BrowserLoginInput struct {
	// BindAddress is the IP-address and port used by the redirect url server
	BindAddress string
	// RedirectURLHostname is the hostname of the redirect URL. You can set this
	// if your provider does not accept localhost.
	RedirectURLHostname string
}

BrowserLoginInput is th input given to Login

type Keyboard

type Keyboard struct {
	// Reader is used to read input from stdin
	Reader reader.Reader
	// Logger holds a logging instance
	Logger logger.Logger
}

Keyboard represents a keyboard based login

func (*Keyboard) Login

func (k *Keyboard) Login(ctx context.Context, in *KeyboardLoginInput, oidcClient oidc.Client) (*oidc.TokenSet, error)

Login performs keyboard based autocode flow, i.e.: 1. Getting the auth code URL from the OIDC issuer 2. Printing the URL and requesting the code to be entered 3. Validating the code and token against the OIDC issuer

type KeyboardLoginInput

type KeyboardLoginInput struct {
	// RedirectURI is the URI used for redirection after login
	RedirectURI string
}

KeyboardLoginInput is the input given to Login

Jump to

Keyboard shortcuts

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