Azure Active Directory OpenID Connect strategy.
Configuration
:tenant_id- the tenant identifier, optional, defaults tocommon. May be a directory ID, verified domain, or one ofcommon,organizations, orconsumers.:base_url- the Microsoft identity platform issuer, optional, defaults tohttps://login.microsoftonline.com/{tenant_id}/v2.0
See Assent.Strategy.OIDC for more.
Usage
config = [
client_id: "REPLACE_WITH_CLIENT_ID",
client_secret: "REPLACE_WITH_CLIENT_SECRET",
redirect_uri: "http://localhost:4000/auth/callback"
]A tenant identifier can be set to limit which users can get access:
config = [
client_id: "REPLACE_WITH_CLIENT_ID",
client_secret: "REPLACE_WITH_CLIENT_SECRET",
tenant_id: "REPLACE_WITH_TENANT_ID",
redirect_uri: "http://localhost:4000/auth/callback"
]Setting up Azure AD
Login to Azure, and set up a new application:
- The callback URL should be added to "Redirect URI" for the application.
client_idis the "Application ID".
Summary
Functions
Generates an OpenID Connect authorization URL.
Handles an OpenID Connect callback.
Fetches user data from an ID Token or the UserInfo endpoint.
Returns user claims without provider-specific normalization.
Functions
@spec authorize_url(Keyword.t()) :: Assent.Strategy.OIDC.on_authorize_url()
Generates an OpenID Connect authorization URL.
@spec callback(Keyword.t(), map()) :: Assent.Strategy.OIDC.on_callback()
Handles an OpenID Connect callback.
Fetches user data from an ID Token or the UserInfo endpoint.
Returns user claims without provider-specific normalization.