Module resty.azure.api.auth
Global authentication.
Functions
authenticate (global_config, opts) | Authenticates to Azure using the given configuration and options. |
get_token (credentials) | Retrieves an access token from the given credentials object. |
Functions
- authenticate (global_config, opts)
-
Authenticates to Azure using the given configuration and options.
Will try to create ClientCredentials, WorkloadIdentityCredentials, and ManagedIdentityCredentials objects
in that order, using the given configuration and options.
Returns the first one that succeeds.
Parameters:
- global_config table The global configuration object.
- opts table The options table passed to the credential objects constructors.
Returns:
-
The authenticated credentials object, or nil+error.
- get_token (credentials)
-
Retrieves an access token from the given credentials object. Any errors will be logged.
Parameters:
- credentials credentials The credentials instance to retrieve the token from.
Returns:
- string the access token
- number its expiry time
Or
- nil
- nil
- string error message