auth0

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth0Client

type Auth0Client struct {
	// contains filtered or unexported fields
}

Auth0 api client object Used to communicate with Auth0 management api using machine credentials

func NewAuth0Client

func NewAuth0Client(logger *log.Logger) *Auth0Client

Create a new client from environment variables requires AUTH0_URL, AUTH0_SECRET and AUTH0_CLIENT_ID to be set

func (*Auth0Client) Close

func (client *Auth0Client) Close()

func (*Auth0Client) GetUser

func (client *Auth0Client) GetUser(email string) (*schema.UserData, error)

Get user info from Auth0 using the email as key

func (*Auth0Client) GetUserById

func (client *Auth0Client) GetUserById(id string) (*schema.UserData, error)

Get user info from Auth0 using its user id as key

func (*Auth0Client) GetUserInfo added in v1.9.5

func (client *Auth0Client) GetUserInfo(authHeader string) (*schema.UserData, error)

Retrieve user information from auth0 based on its access token

func (*Auth0Client) Start

func (client *Auth0Client) Start() error

Get an auth token and initiate the token refresh loop

func (*Auth0Client) UpdateUser

func (client *Auth0Client) UpdateUser(id string, user *schema.UserUpdate) error

Update a user on Auth0 Only the Email and Password can be udated for now Updating both email and password at the same time will throw an error (not accepted by Auth0)

type ClientInterface added in v1.11.0

type ClientInterface interface {
	GetUser(email string) (*schema.UserData, error)
	GetUserById(id string) (*schema.UserData, error)
	UpdateUser(id string, user *schema.UserUpdate) error
	GetUserInfo(authHeader string) (*schema.UserData, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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