Documentation ¶
Index ¶
- Constants
- func RequiredScopes() []string
- func RequiredScopesMin() []string
- type Auth
- func (t Auth) GetFreshAccessTokenOrLogin() (string, error)
- func (t Auth) GetFreshAccessTokenOrNil() (string, error)
- func (t Auth) Login() (*LoginTokens, error)
- func (t Auth) Logout() error
- func (t Auth) PromptForLogin() (*LoginTokens, error)
- func (t *Auth) WithAccessTokenValidator(val func(string) (bool, error)) *Auth
- type AuthStore
- type Authenticator
- func (a Authenticator) DoDeviceAuthFlow(onStateRetrieved func(url string, code string)) (*LoginTokens, error)
- func (a Authenticator) GetNewAuthTokensWithRefresh(refreshToken string) (*entity.AuthTokens, error)
- func (a *Authenticator) Start(ctx context.Context) (State, error)
- func (a *Authenticator) Wait(ctx context.Context, state State) (Result, error)
- type LoginAuth
- type LoginTokens
- type NoLoginAuth
- type OAuth
- type Result
- type State
Constants ¶
View Source
const (
// namespace used to set/get values from the keychain.
SecNamespace = "auth0-cli"
)
Variables ¶
This section is empty.
Functions ¶
func RequiredScopes ¶
func RequiredScopes() []string
RequiredScopes returns the scopes used for login.
func RequiredScopesMin ¶
func RequiredScopesMin() []string
RequiredScopesMin returns minimum scopes used for login in integration tests.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func (Auth) GetFreshAccessTokenOrLogin ¶
Gets fresh access token and prompts for login and saves to store
func (Auth) GetFreshAccessTokenOrNil ¶
Gets fresh access token or returns nil and saves to store
func (Auth) Login ¶
func (t Auth) Login() (*LoginTokens, error)
func (Auth) PromptForLogin ¶
func (t Auth) PromptForLogin() (*LoginTokens, error)
Prompts for login and returns tokens, and saves to store
type AuthStore ¶
type AuthStore interface { SaveAuthTokens(tokens entity.AuthTokens) error GetAuthTokens() (*entity.AuthTokens, error) DeleteAuthTokens() error }
type Authenticator ¶
type Authenticator struct { Audience string ClientID string DeviceCodeEndpoint string OauthTokenEndpoint string }
func (Authenticator) DoDeviceAuthFlow ¶
func (a Authenticator) DoDeviceAuthFlow(onStateRetrieved func(url string, code string)) (*LoginTokens, error)
func (Authenticator) GetNewAuthTokensWithRefresh ¶
func (a Authenticator) GetNewAuthTokensWithRefresh(refreshToken string) (*entity.AuthTokens, error)
type LoginAuth ¶
type LoginAuth struct {
Auth
}
func NewLoginAuth ¶
func (LoginAuth) GetAccessToken ¶
type LoginTokens ¶
type LoginTokens struct { entity.AuthTokens IDToken string }
type NoLoginAuth ¶
type NoLoginAuth struct {
Auth
}
func NewNoLoginAuth ¶
func NewNoLoginAuth(authStore AuthStore, oauth OAuth) *NoLoginAuth
func (NoLoginAuth) GetAccessToken ¶
func (l NoLoginAuth) GetAccessToken() (string, error)
type OAuth ¶
type OAuth interface { DoDeviceAuthFlow(onStateRetrieved func(url string, code string)) (*LoginTokens, error) GetNewAuthTokensWithRefresh(refreshToken string) (*entity.AuthTokens, error) }
Click to show internal directories.
Click to hide internal directories.