Azure AD as an identity provider
The following Azure AD values are required to set up the integration:
- Application (client) ID
- Directory (tenant) ID
- Client secret
To retrieve those values:
- Log in to the Azure dashboard.
- Navigate to All services > Azure Active Directory.
- In the Azure Active Directory menu, go to Enterprise applications.
- Select New application > Create your own application.
- Name your application.
- Select Register an application to integration with Azure AD (App you’re developing) and then select Create.
- Under Redirect URI, select the Web platform and enter the following URL:
https://<your-team-name>.cloudflareaccess.com/cdn-cgi/access/callback
You can find your team name in Zero Trust under Settings > General.

- Select Register.
- Next, return to the Azure Active Directory menu and go to App registrations.
- Select the app you just created. Copy the Application (client) ID and Directory (tenant) ID.
Viewing the Application ID and Directory ID in Azure
- Navigate to Certificates & secrets and select New client secret.
- Name the client secret and choose an expiration period.
- After the client secret is created, copy its Value field. Store the client secret in a safe place, as it can only be viewed immediately after creation.
- From the App registrations page for your application, navigate to API permissions.
- Select Add a permission.
- Select Microsoft Graph.
- Select Delegated permissions and enable the following permissions:
- offline_access
- openid
- profile
- User.Read
- Directory.Read.All
- GroupMember.Read.All
More narrow permissions may be used, however this is the set of permissions that are tested and supported by Cloudflare.
- Once all seven permissions are enabled, select Add permissions.
- Select Grant admin consent.
- In Zero Trust, navigate to Settings > Authentication.
- Under Login methods, select Add new.
- Select Azure AD.
- Enter the Application (client) ID, Client secret, and Directory (tenant) ID obtained from the Azure dashboard.
- (Optional) Enable Proof of Key Exchange (PKCE). PKCE will be performed on all login attempts.
- (Optional) If you are using Azure AD groups, enable Support Groups.
- Select Save.
- To test if an IdP is correctly configured, navigate to Settings > Authentication. Next, click Test next to the IdP you would like to test. This will attempt to connect to the IdP to verify if a valid connection is established.