View Source ExAzureKeyVault.ClientAssertionAuth (ex_azure_key_vault v2.2.0)

Internal module for getting authentication token for Azure connection using client assertion.

Link to this section Summary

Functions

Returns bearer token for Azure connection using client assertion.

Creates %ExAzureKeyVault.ClientAssertionAuth{} struct with account tokens and cert data.

Link to this section Types

@type t() :: %ExAzureKeyVault.ClientAssertionAuth{
  cert_base64_thumbprint: String.t(),
  cert_private_key_pem: String.t(),
  client_id: 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 using client assertion.

examples

Examples

iex(1)> ExAzureKeyVault.ClientAssertionAuth.new("6f185f82-9909...", "6f1861e4-9909...", "Dss7v2YI3GgCGfl...", "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEF...")
...(1)> |> ExAzureKeyVault.ClientAssertionAuth.get_bearer_token()
{:ok, "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."}
Link to this function

new(client_id, tenant_id, cert_base64_thumbprint, cert_private_key_pem)

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

Creates %ExAzureKeyVault.ClientAssertionAuth{} struct with account tokens and cert data.

examples

Examples

iex(1)> ExAzureKeyVault.ClientAssertionAuth.new("6f185f82-9909...", "6f1861e4-9909...", "Dss7v2YI3GgCGfl...", "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEF...")
%ExAzureKeyVault.ClientAssertionAuth{
  client_id: "6f185f82-9909...",
  tenant_id: "6f1861e4-9909...",
  cert_base64_thumbprint: "Dss7v2YI3GgCGfl...",
  cert_private_key_pem: "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEF..."
}