Documentation ¶
Overview ¶
Package userauth implements the OAuth2 native app authorization described in rfc8252. This helps CLI client to get access token.
It uses loopback device and by default uses any free port according to https://datatracker.ietf.org/doc/html/rfc8252#section-7.3
To configure this, you'll need to add a couple of redirect URLs like http://127.0.0.1:<your-port> into the okta application sign-in redirect URIs. And use WithLocalServerBindAddress to configure the context to only uses ports list from your assigned list.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option configures optional field for TokenSource, it's an interface with private function, hence can only be created within the pkg.
func UseBindAddress ¶
UseBindAddress provides a way to bind local server on pre-configured addresses.
The RFC8252 requires port to be any port when using loopback interface redirection, hence the default behavior is using first free port and 127.0.0.1 address https://datatracker.ietf.org/doc/html/rfc8252#section-7.3
In case running it in container, it will need to bind on 0.0.0.0 or other addresses.
func UseHTTPClient ¶
UseHTTPClient sets http client used to make http requests.
func UseRedirectHostname ¶
UseRedirectHostname provides a way to set redirect hostname.
The RFC8252 requires 127.0.0.1 address to for safety reason. You can set this if your provider does not accept 127.0.0.1
func UseURLOpener ¶
UseURLOpener sets URL opener for tokensource
type TokenSource ¶
type TokenSource struct {
// contains filtered or unexported fields
}