View Source AzureADOpenId (Azure Active Directory OpenID v0.3.3)

Azure Active Directory authentication using OpenID.

Link to this section Summary

Functions

Get a redirect url for authorization using Azure Active Directory login.

Checks if the library is configured with the standard Elixir configuration (i.e. using the config files).

Get an access token using the client credentials authorisation strategy for machine to machine authentication. Requires a client secret.

Returns a human readable user name from an id_token/0. This is useful as the Azure Active Directory id_token/0 can be very inconsistent in how user names are stored.

Handles and validates the id_token/0 in the callback response. The redirect_uri used in the authorize_url!/1 function should redirect to a path that uses this funtion.

Returns the redirect url for logging out of Azure Active Directory.

Returns the redirect url for logging out of Azure Active Directory.

Link to this section Types

Specs

callback_response() :: {:ok, id_token()} | {:error, String.t(), String.t()}

Specs

config() :: nil | [config_values()]

Specs

config_values() :: {:tenant, String.t()} | {:client_id, String.t()}

Specs

conn() :: map()

Specs

id_token() :: map()

Specs

uri() :: String.t()

Link to this section Functions

Link to this function

authorize_url!(redirect_uri, config \\ nil)

View Source

Specs

authorize_url!(uri(), config()) :: uri()

Get a redirect url for authorization using Azure Active Directory login.

Specs

configured?() :: boolean()

Checks if the library is configured with the standard Elixir configuration (i.e. using the config files).

Link to this function

get_access_token!(config \\ nil)

View Source

Get an access token using the client credentials authorisation strategy for machine to machine authentication. Requires a client secret.

Specs

get_user_name(id_token()) :: String.t()

Returns a human readable user name from an id_token/0. This is useful as the Azure Active Directory id_token/0 can be very inconsistent in how user names are stored.

Link to this function

handle_callback!(conn, config \\ nil)

View Source

Specs

handle_callback!(conn(), config()) :: callback_response()

Handles and validates the id_token/0 in the callback response. The redirect_uri used in the authorize_url!/1 function should redirect to a path that uses this funtion.

Link to this function

logout_url(redirect_uri)

View Source

Specs

logout_url(uri()) :: uri()

Returns the redirect url for logging out of Azure Active Directory.

Link to this function

logout_url(config \\ nil, redirect_uri \\ nil)

View Source

Specs

logout_url(config(), uri() | nil) :: uri()

Returns the redirect url for logging out of Azure Active Directory.

Link to this function

verify_access_token!(access_token, config \\ nil)

View Source

Verify an access token.