gf_auth0

package
v0.0.0-...-a1b0e2b Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAccessToken

func GenerateAccessToken(pAppClientIDstr string,
	pAppClientSecretStr string,
	pAudienceStr string,
	pAuth0appDomainStr string,
	pCtx context.Context,
	pRuntimeSys *gf_core.RuntimeSys) (string, *gf_core.GFerror)

-------------------------------------------------------------

func GetUserInfo

func GetUserInfo(pAuth0accessTokenStr string,
	pAuth0domainStr string,
	pRuntimeSys *gf_core.RuntimeSys) (map[string]interface{}, *gf_core.GFerror)

pAccessTokenStr - Auth0 Access Token obtained during login

func Init

func Init(pRuntimeSys *gf_core.RuntimeSys) (*GFauthenticator, *GFconfig, *gf_core.GFerror)

func JWTgetPublicKeyForTenant

func JWTgetPublicKeyForTenant(pConfig *GFconfig,
	pRuntimeSys *gf_core.RuntimeSys) (string, *rsa.PublicKey, *gf_core.GFerror)

func JWTvalidateToken

func JWTvalidateToken(pTokenStr string,
	pPubKey *rsa.PublicKey,
	pRuntimeSys *gf_core.RuntimeSys) (string, *gf_core.GFerror)

validate given JWT token. a public key used for JWT signature validation is passed as the argument. function either fails or succeeds and returns if the key is valid.

func VerifyIDtoken

func VerifyIDtoken(pOauth2bearerToken *oauth2.Token,
	pAuthenticator *GFauthenticator,
	pCtx context.Context,
	pRuntimeSys *gf_core.RuntimeSys) (*oidc.IDToken, *gf_core.GFerror)

verifies that an Oauth2 token is a valid *oidc.IDToken.

Types

type GFauthenticator

type GFauthenticator struct {
	*oidc.Provider
	oauth2.Config
}

type GFconfig

type GFconfig struct {

	// AUTH0_DOMAIN
	Auth0domainStr string

	// CLIENT_ID/SECRET
	Auth0clientIDstr     string
	Auth0clientSecretStr string

	// AUDIENCE
	Auth0apiAudienceStr string

	// CALLBACK_URLS
	Auth0loginCallbackURLstr  string
	Auth0logoutCallbackURLstr string
}

func LoadConfig

func LoadConfig(pRuntimeSys *gf_core.RuntimeSys) *GFconfig

load Auth0 config, mostly from ENV vars

type GFonLoginSuccessProfileInfo

type GFonLoginSuccessProfileInfo struct {
	SubStr        string
	NicknameStr   string
	NameStr       string
	PictureURLstr string
}

Jump to

Keyboard shortcuts

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