Documentation
¶
Overview ¶
authorization package contains the abstraction for handling the different authorization methods and manage the tokens retrivial and refresh
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAuthenticator ¶
func NewAuthenticator(config *client.Config, cacheReadWriter client.AuthCacheReadWriter, authConfig client.AuthConfig) client.AuthProvider
Types ¶
type Config ¶
type Config struct { // AppID the app id to use for getting the correct authorization from the Mia-Platform console AppID string // LocalServerBindAddress hostname and port which the local server binds to, you can use the // port 0 for allocate the first free port LocalServerBindAddress []string // Client the http client to use for sending the request Client client.Interface // ServerReadyHandler function to call when the local server is ready to receive traffic ServerReadyHandler LocalServerReadyHandler }
func (*Config) GetToken ¶
GetToken performs the authorization flow against the Mia-Platform Console This perform the following actions: 1. Send a request for getting the provider id for the configured AppID 2. Start a local server for intercetting the callback 3. Open the browser and start the login flow 4. Wait for the user authorization 5. Exchange the code received via callback 6. Return the oauth2 token
type LocalServerReadyHandler ¶
Click to show internal directories.
Click to hide internal directories.