Microsoft
Firstly, we need to obtain credentials such as
Tenant IDClient IDClient secret
If you already have them, please skip to Configuring Microsoft as external OIDC in Defguard
Obtaining basic credentials
Navigate to Microsoft Entra ID
In the Microsoft Entra ID, click Manage and select App registrations from the menu on the left.

Click "Make new registration"
Fill out the form, like in the example:

Make sure the Redirect URL you insert here is correct. The full list of redirect URLs that should be configured in order to use all features is available here.
You should be now on the registered application's management screen. You can copy the client's ID and the tenant ID from here, as you need to provide them on the Defguard settings' page.

Now back in Microsoft Entra ID, still in your newly created application, go to Certificates & Secrets

Go to
Certificates & secretsand create a new client secret. Copy its value.

Go to Token configuration (in the menu on the left) and add a new optional token claim.
Make sure to select the ID token type and the following claims:

Accept the popup or configure the API permissions manually.

Now you should be good to go.
Obtaining Directory Synchronization credentials
This feature is available only in Defguard 1.2.1 and above
This feature is currently technically limited to 10000 members or groups. High user or group counts may still trigger your provider API limits even below this threshold. If you have many users (200+), we recommend you test this feature first before you decide to turn on automatic user deletion.
Defguard supports synchronizing groups' and users' states based on your Microsoft directory.
Make sure to check the general guide to directory synchronization to learn more about the available configuration options.
Setup
Go back to your app registrations in Microsoft Entra ID and select the app you registered during the provider setup.
Navigate to API permissions

Click "Add a permission", then select "Microsoft Graph"

Select "Application permissions", as Defguard will perform the synchronization in the background.

Assign the following permissions:
GroupMember.Read.AllGroup.Read.AllUser.Read.All
Now grant admin consent for the permissions using the "Grant admin consent for" button\

You should be good to go now. Navigate to the directory sync settings in Defguard and try to test your setup using the test connection button.
Configuring Microsoft as external OIDC in Defguard
Go to Settings → External identity providers.

Click "Connect" in row with Microsoft.

Fill out Tenant ID, Client ID, Client secret (Check Obtaining basic credentials)

Click "Continue"
If you decide to use Directory Synchronization, enable it. (If you don't need Directory Synchronization, go to step 6).

In order for Entra users to be created in Defguard they must have the following attributes set:
email (or otherMails)
first name
last name
By default, directory sync guaranteed only that the state and group membership of Defguard users also present in the directory is up-to-date. It does not create Defguard users until they log in using an External OpenID provider.
To create Defguard users during directory sync enable the Prefetch users option:

Click "Continue"

If no errors occurred during configuration, you will see a message indicating that your OIDC provider has been successfully added.
Click "Finish"
Last updated
Was this helpful?