ex_azure_key_vault v0.0.2 ExAzureKeyVault.Auth View Source

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

Link to this type t() View Source
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
get_bearer_token(ExAzureKeyVault.Auth.t()) ::
  {:ok, String.t()} | {:error, any()}

Returns bearer token for Azure connection.

Examples

iex> ExAzureKeyVault.Auth.get_bearer_token(
%ExAzureKeyVault.Auth{
  client_id: "f7ad46c2-9987...",
  client_secret: "f7ad4924-9987...",
  tenant_id: "f7ad4302-9987..."
})
{:ok, "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."}
Link to this function new(client_id, client_secret, tenant_id) View Source

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

Examples

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