Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAuthTokenProvider ¶
func NewAuthTokenProvider( appCtx context.Context, clientID, clientSecret string, options *Options, ) (*authTokenProvider, error)
NewAuthTokenProvider creates a new AuthTokenProvider with the given context and options. If options is set to nil then the default options will be used.
The supplied app context will be passed when performing background operations such as refreshing the access token, which ensures that no operation outlives the lifetime of the application.
By default the AuthTokenProvider will fetch the client ID and client secret from the environment variables `STATELY_CLIENT_ID` and `STATELY_CLIENT_SECRET`, however these can be explicitly overridden by passing credentials in the options. If no credentials are found, NewAuthTokenProvider will return an error.
Types ¶
type Options ¶
type Options struct { // Domain is the domain to query for auth tokens. // Defaults to https://oauth.stately.cloud Domain string // Audience is the audience that the provider will request tokens for. // Defaults to api.stately.cloud Audience string }
Options is a struct of options to be passed to NewAuthTokenProvider. This can be omitted to use the default options or can be passed explicitly with any overrides.