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:

  1. string the access token
  2. number its expiry time

Or

  1. nil
  2. nil
  3. string error message
generated by LDoc 1.5.0 Last updated 2024-03-29 13:25:29