auth0

package module
v0.0.0-...-27d1d2d Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2021 License: MIT Imports: 17 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateUser

func AuthenticateUser(email, password string) (interface{}, error)

AuthenticateUser authenticates an auth0 user

func CreateUser

func CreateUser(params map[string]interface{}) (interface{}, error)

CreateUser creates an auth0 user

func DeleteUser

func DeleteUser(auth0UserID string) (interface{}, error)

DeleteUser deletes an auth0 user

func ExportUsers

func ExportUsers() ([]interface{}, error)

ExportUsers returns an export of all auth0 users

func GetJWKs

func GetJWKs() (map[string]interface{}, error)

GetJWKs

func GetJob

func GetJob(auth0JobID string) (interface{}, error)

GetJob returns an auth0 job by id

func GetUser

func GetUser(auth0UserID string) (interface{}, error)

GetUser returns an auth0 user by id

func GetUserByEmail

func GetUserByEmail(email string) (interface{}, error)

GetUserByEmail returns an auth0 user by email address

func RequireAuth0

func RequireAuth0()

RequireAuth0 reads the Auth0 configuration from the environment

func UpdateUser

func UpdateUser(auth0UserID string, params map[string]interface{}) (interface{}, error)

UpdateUser updates an auth0 user

Types

type Auth0APIClient

type Auth0APIClient struct {
	Host                string
	OAuthAccessTokenURL string
	Path                string
	Scheme              string
	Token               *string
	TokenExpiresAt      *time.Time
	Username            *string
	Password            *string
}

Auth0APIClient is a generic base class for calling a REST API; when a token is configured on an Auth0APIClient instance it will be provided as a bearer authorization header; when a username and password are configured on an Auth0APIClient instance, they will be used for HTTP basic authorization but will be passed as the Authorization header instead of as part of the URL itself. When a token is confgiured on an Auth0APIClient instance, the username and password supplied for basic auth are currently discarded.

func NewAuth0APIClient

func NewAuth0APIClient() (*Auth0APIClient, error)

NewAuth0APIClient initializes a Auth0APIClient to interact with the Auth0 API using the environment-configured Auth0 API credentials.

func NewAuth0APIClientWithPath

func NewAuth0APIClientWithPath(path string) (*Auth0APIClient, error)

NewAuth0APIClientWithPath initializes a Auth0APIClient to interact with the Auth0 API using the environment-configured Auth0 API credentials and given path.

func (*Auth0APIClient) Delete

func (c *Auth0APIClient) Delete(uri string) (status int, response interface{}, err error)

Delete constructs and synchronously sends an API DELETE request

func (*Auth0APIClient) DeleteWithTLSClientConfig

func (c *Auth0APIClient) DeleteWithTLSClientConfig(uri string, tlsClientConfig *tls.Config) (status int, response interface{}, err error)

DeleteWithTLSClientConfig constructs and synchronously sends an API DELETE request

func (*Auth0APIClient) Get

func (c *Auth0APIClient) Get(uri string, params map[string]interface{}) (status int, response interface{}, err error)

Get constructs and synchronously sends an API GET request

func (*Auth0APIClient) GetWithTLSClientConfig

func (c *Auth0APIClient) GetWithTLSClientConfig(uri string, params map[string]interface{}, tlsClientConfig *tls.Config) (status int, response interface{}, err error)

GetWithTLSClientConfig constructs and synchronously sends an API GET request

func (*Auth0APIClient) Patch

func (c *Auth0APIClient) Patch(uri string, params map[string]interface{}) (status int, response interface{}, err error)

Patch constructs and synchronously sends an API PATCH request

func (*Auth0APIClient) Post

func (c *Auth0APIClient) Post(uri string, params map[string]interface{}) (status int, response interface{}, err error)

Post constructs and synchronously sends an API POST request

func (*Auth0APIClient) PostMultipartFormData

func (c *Auth0APIClient) PostMultipartFormData(uri string, params map[string]interface{}) (status int, response interface{}, err error)

PostMultipartFormData constructs and synchronously sends an API POST request using multipart/form-data as the content-type

func (*Auth0APIClient) PostMultipartFormDataWithTLSClientConfig

func (c *Auth0APIClient) PostMultipartFormDataWithTLSClientConfig(uri string, params map[string]interface{}, tlsClientConfig *tls.Config) (status int, response interface{}, err error)

PostMultipartFormDataWithTLSClientConfig constructs and synchronously sends an API POST request using multipart/form-data as the content-type

func (*Auth0APIClient) PostWWWFormURLEncoded

func (c *Auth0APIClient) PostWWWFormURLEncoded(uri string, params map[string]interface{}) (status int, response interface{}, err error)

PostWWWFormURLEncoded constructs and synchronously sends an API POST request using application/x-www-form-urlencoded as the content-type

func (*Auth0APIClient) PostWWWFormURLEncodedWithTLSClientConfig

func (c *Auth0APIClient) PostWWWFormURLEncodedWithTLSClientConfig(uri string, params map[string]interface{}, tlsClientConfig *tls.Config) (status int, response interface{}, err error)

PostWWWFormURLEncodedWithTLSClientConfig constructs and synchronously sends an API POST request using application/x-www-form-urlencoded as the content-type

func (*Auth0APIClient) PostWithTLSClientConfig

func (c *Auth0APIClient) PostWithTLSClientConfig(uri string, params map[string]interface{}, tlsClientConfig *tls.Config) (status int, response interface{}, err error)

PostWithTLSClientConfig constructs and synchronously sends an API POST request

func (*Auth0APIClient) Put

func (c *Auth0APIClient) Put(uri string, params map[string]interface{}) (status int, response interface{}, err error)

Put constructs and synchronously sends an API PUT request

func (*Auth0APIClient) PutWithTLSClientConfig

func (c *Auth0APIClient) PutWithTLSClientConfig(uri string, params map[string]interface{}, tlsClientConfig *tls.Config) (status int, response interface{}, err error)

PutWithTLSClientConfig constructs and synchronously sends an API PUT request

type Auth0OAuthTokenResponse

type Auth0OAuthTokenResponse struct {
	AccessToken *string       `json:"access_token"`
	TokenType   *string       `json:"token_type"`
	ExpiresIn   time.Duration `json:"expires_in"`
}

type JSONWebKey

type JSONWebKey struct {
	Kty string   `json:"kty"`
	Kid string   `json:"kid"`
	Use string   `json:"use"`
	N   string   `json:"n"`
	E   string   `json:"e"`
	X5c []string `json:"x5c"`
}

JSONWebKey represents an auth0 JWT

type JWTKeys

type JWTKeys struct {
	Keys []*JSONWebKey `json:"keys"`
}

JWTKeys lists the JWT keys

Jump to

Keyboard shortcuts

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