auth

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadPasswordWithOTP

func ReadPasswordWithOTP() (string, string, error)

func RequestJWT

func RequestJWT(username, password, otp, tokenUrl, clientid, clientsecret, clientscope string) (string, error)

Types

type OIDCProviderInfo added in v0.1.3

type OIDCProviderInfo struct {
	Issuer      string      `json:"issuer"`
	AuthURL     string      `json:"authorization_endpoint"`
	TokenURL    string      `json:"token_endpoint"`
	JWKSURL     string      `json:"jwks_uri"`
	UserInfoURL string      `json:"userinfo_endpoint"`
	Algorithms  []string    `json:"id_token_signing_alg_values_supported"`
	KeySet      oidc.KeySet `json:",omitempty"`
}

func GetProviderInfo added in v0.1.3

func GetProviderInfo(providerEndpoint string) (*OIDCProviderInfo, error)

func (*OIDCProviderInfo) VerifyToken added in v0.1.3

func (provider *OIDCProviderInfo) VerifyToken(aToken string) error

type Token

type Token struct {
	// AccessToken is the token that authorizes and authenticates
	// the requests.
	AccessToken  string    `json:"access_token"`
	TokenType    string    `json:"token_type,omitempty"`
	RefreshToken string    `json:"refresh_token,omitempty"`
	Expiry       time.Time `json:"expiry,omitempty"`
}

Jump to

Keyboard shortcuts

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