auth0

package
v0.0.0-...-35b150b Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package auth0 provides methods to authenticate with auth0

Index

Constants

This section is empty.

Variables

View Source
var DefaultClient = &Client{
	formPost: formPost,
	viper:    viper.GetViper(),
}

Functions

This section is empty.

Types

type Auth0

type Auth0 interface {
	IDToken() (string, error)
	Login(headless bool, persistent bool) error
	Secret() (string, bool)
}

type Client

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

func (*Client) IDToken

func (c *Client) IDToken() (string, error)

IDToken returns a valid auth0 access token If a non-expired access token is found in the cache that token is returned. Otherwise the secret/refresh token from the application config is used to fetch a fresh one. If there is no secret configured this function errors.

func (*Client) Login

func (c *Client) Login(headless bool, persistent bool) error

Login performs the auth0 device authorization flow: https://auth0.com/docs/flows/call-your-api-using-the-device-authorization-flow This function prompts the user to navigate to a URL or directs the user there.

func (*Client) Secret

func (c *Client) Secret() (string, bool)

Secret returns the auth0 secret/refresh token and a boolean representing whether the secret is defined.

Jump to

Keyboard shortcuts

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