Cloudflare Access IdP with Entra ID

Cloudflare Access IdP with Entra ID

Cloudflare Access is a wonderful tool that can add MFA (Multi-Factor Authentication) to applications that don’t support it.

I’ve previously covered Setting Up Cloudflare Access using email OTP (One-time PIN). What I didn’t cover in that post was how to set up Cloudflare Access with an IdP (Identity Provider).

In this post, I will show step-by-step how to set up Cloudflare Access to use Microsoft Entra ID (formerly Microsoft Azure Active Directory) as the IdP and use Microsoft 365 SSO (Single sign-on) to make everything very transparent to the user.

Prerequisites

The Process

For this example, I will be using the team domain test.cloudflareaccess.com

Microsoft Entra ID Configuration

In my example, my Team domain is test.cloudflareaccess.com and I will enter the following for the Redirect URI URL: https://test.cloudflareaccess.com/cdn-cgi/access/callback

It should look something like this.

In my example, I will note that my Application (client) ID is 1234-app-client-id and my Directory (tenant) ID is 8901-tenant-id.

Once you navigate away, you can no longer access the Value again.

Once admin consent is granted, the permissions should look like this.

I want to lock down the users who can authenticate to the Cloudflare Access application in Entra ID. I can do that by enabling the assignment required on the Cloudflare Access Enterprise application.

In my case, that will be the application named Cloudflare Access.

In my example, I will be using a group named Cloudflare Access.

Now no one can use the Cloudflare Access application in Entra ID unless they are a direct member of the group.

Cloudflare Configuration

Let’s test and ensure everything works between Cloudflare and Microsoft Entra ID.

If everything works, you should see a screen like this.

We should now have the application configured, and the Applications screen should look like this.

If we try to access the application, we will have to satisfy the Cloudflare Access conditions before we can do so.

Because we have it configured to automatically assume the use of Entra ID when visiting the application, the user will see the Microsoft 365 login prompt before they can access the application.

This configuration also takes advantage of Microsoft 365 SSO and will reduce the number of times the user sees the additional login prompt before accessing the application.

If a user is not a member of the required groups specified in the Entra ID Enterprise application, they will get a Microsoft 365 error screen that looks like this.

Another error message users can encounter is the Cloudflare Access denied screen. This typically shows up if you don’t lock down the Microsoft Entra ID application to assigned access and you specify the group as a required group in Cloudflare only and the user is not a member of the group.

This configuration is ideal for web applications lacking MFA support, commonly seen with SCADA and internal corporate web applications.

If you want to read more about SSO with Cloudflare Access here is the Cloudflare documentation about it.

Exit mobile version