View Source ExAzureKeyVault.Auth (ex_azure_key_vault v2.2.1)

Internal module for getting authentication token for Azure connection.

Link to this section Summary

Functions

Returns bearer token for Azure connection.

Creates %ExAzureKeyVault.Auth{} struct with account tokens.

Link to this section Types

@type t() :: %ExAzureKeyVault.Auth{
  client_id: String.t(),
  client_secret: String.t(),
  tenant_id: String.t()
}

Link to this section Functions

Link to this function

get_bearer_token(params)

View Source
@spec get_bearer_token(t()) :: {:ok, String.t()} | {:error, any()}

Returns bearer token for Azure connection.

examples

Examples

iex(1)> ExAzureKeyVault.Auth.new("6f185f82-9909...", "6f1861e4-9909...", "6f185bb8-9909...")
...(1)> |> ExAzureKeyVault.Auth.get_bearer_token()
{:ok, "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."}
Link to this function

new(client_id, client_secret, tenant_id)

View Source
@spec new(String.t(), String.t(), String.t()) :: t()

Creates %ExAzureKeyVault.Auth{} struct with account tokens.

examples

Examples

iex(1)> ExAzureKeyVault.Auth.new("6f185f82-9909...", "6f1861e4-9909...", "6f185bb8-9909...")
%ExAzureKeyVault.Auth{
  client_id: "6f185f82-9909...",
  client_secret: "6f1861e4-9909...",
  tenant_id: "6f185bb8-9909..."
}