auth

package
v0.0.0-...-314bee3 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsUserInGroup

func IsUserInGroup(kcURL, accessToken, groupName string) (bool, error)

func ReadPasswordWithOTP

func ReadPasswordWithOTP() (string, string, error)

func RequestJWT

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

Types

type OIDCProviderInfo

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

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

func (*OIDCProviderInfo) VerifyToken

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"`
}

type Userinfo

type Userinfo struct {
	Id                string   `json:"sub"`
	EmailVerified     bool     `json:"email_verified"`
	Name              string   `json:"name"`
	Groups            []string `json:"groups"`
	PreferredUsername string   `json:"preferred_username"`
	GivenName         string   `json:"given_name"`
	FamilyName        string   `json:"family_name"`
	Email             string   `json:"email"`
}

Jump to

Keyboard shortcuts

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