2.1 KiB
2.1 KiB
Authentication Guide: Azure Active Directory
-
Login or Sign-up on portal.azure.com
-
Navigate to Azure Active Directory from the homepage or the sidebar.

-
In the next page, click on
Add a certificate or secretthen navigate toClient Secrets.
Create a new client secret, add a description of your choice and copy the secret value.

-
Navigate to authentication page, then add a new platform. Select web as the platform.

-
Set the
Redirect URItohttps://YOURHOSTNAME/auth/oauth2/callback. CheckID Tokensand uncheckAccess Token.

-
Retrieve the APPLICATION-ID and DIRECTORY-ID from the "Overview" section.

-
Pass in your credentials as environment variables down below.
CMD_OAUTH2_USER_PROFILE_URL=graph.microsoft.com/v1.0/me
CMD_OAUTH2_USER_PROFILE_USERNAME_ATTR=userPrincipalName
CMD_OAUTH2_USER_PROFILE_DISPLAY_NAME_ATTR=displayName
CMD_OAUTH2_USER_PROFILE_EMAIL_ATTR=mail
CMD_OAUTH2_USER_PROFILE_ID_ATTR=id
CMD_OAUTH2_TOKEN_URL=https://login.microsoftonline.com/**DIRECTORY-ID**/oauth2/v2.0/token
CMD_OAUTH2_AUTHORIZATION_URL=https://login.microsoftonline.com/**DIRECTORY-ID**/oauth2/v2.0/authorize
CMD_OAUTH2_CLIENT_ID=APPLICATION-ID
CMD_OAUTH2_CLIENT_SECRET=CLIENT-SECRET
CMD_OAUTH2_PROVIDERNAME=AzureAD
CMD_OAUTH2_SCOPE=openid offline_access email profile User.Read

