oidc

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logout

func Logout(ctx context.Context, chromeURL string, cnf *LogoutConfig) error

Logout logs a user out and revoke the specified ID token.

Types

type LoginConfig

type LoginConfig struct {
	Endpoint      string // an OpenID Connect endpoint
	ClientID      string // a client's ID
	RedirectURI   string // a client's redirect uri
	Scopes        string // OpenID Connect scopes
	Username      string // a user's name
	Password      string // a user's password
	PasswordStdin bool   // a user's password from stdin
	UsernameField string // a CSS selector of the username field on the login form
	PasswordField string // a CSS selector of the password field on the login form
	SubmitButton  string // a CSS selector of the submit button on the login form
	ErrorMessage  string // a CSS selector of an error message on the login form
}

LoginConfig is a configuration of the login process.

type LoginData

type LoginData struct {
	AccessToken string `json:"access_token"`
	IDToken     string `json:"id_token"`
}

LoginData is a successful result of the login process.

func Login

func Login(ctx context.Context, chromeURL string, cnf *LoginConfig) (*LoginData, error)

Login authenticates a user by opening the login page of an OpenID Connect Provider, and emulating user's actions to fill the authentication parameters and clicking the login button. The function returns a struct that contains an access token an ID token of the authenticated user.

type LogoutConfig

type LogoutConfig struct {
	Endpoint string // an OpenID Connect endpoint
	IDToken  string // an ID token
}

LogoutConfig is a configuration of the logout process.

Jump to

Keyboard shortcuts

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