Die BPC Version 4.1 wird nicht mehr gewartet.

Sollten Sie diese BPC Version nutzen, empfehlen wir Ihnen eine Migration auf eine aktuelle Version. Die Dokumentation zur neusten BPC Version finden Sie hier. Sollten Sie Fragen haben, wenden Sie sich bitte an unseren Support.

Setting Up Microsoft Azure AD as an IdP in Keycloak

This page describes how to configure Microsoft Azure AD as an additional identity provider (IdP). This option will then appear as an additional button on the login page.

Setting Up an Application in Microsoft Azure AD

In order for Keycloak to authenticate, it must be registered as an application in Azure Active Directory (AD).

Add a New Application

First, a new “app” must be registered in Azure AD.

  1. To do this, navigate to the “App Registrations” menu item

    Do not confuse this with the “Enterprise Applications” section. However, it can also be found there later.

    new app 1
  2. Next, assign a descriptive name.

    new app 2
  3. Next, a secret key must be generated for the client (Keycloak).

    add client secret 1
  4. The key is displayed immediately after generation and should be saved right away. It will not be possible to view the key later. If the key is lost, a new one must be generated.

    add client secret 2
  5. Afterward, in addition to the secret key, you must also determine the client ID and the URL for the OpenID Connect configuration.

    azure get url and id

Configure the IdP in Keycloak

Now you can create a new Identity Provider in Keycloak.

Do not select “Microsoft” under “Social” here. For this option, the client must be configured differently in Azure AD, as this would allow login with any Microsoft account (even outside your own organization).

add idp 1
  1. The first step is to assign an alias. This affects the redirect URI, which we’ll need later. The display name ultimately determines the label shown in the application’s login screen.

    add idp 2
  2. Next, use the OpenID Connect URL from Azure AD to configure the endpoints. To do this, enter it accordingly and load it using the "Import" button.
    Afterward, all relevant URLs will be filled in automatically.

    add idp 3
  3. Finally, enter the client ID and secret key_._

    add idp 4
  4. The redirect URI from the previous step must now be configured in Azure AD.

    set callback url

Result

Finally, a login screen with additional buttons should be available.

login

Troubleshooting

In this setup, it’s not so easy to find errors. The logs in Keycloak can be a useful resource. If in doubt, however, the key is to determine what is wrong on the Azure AD side. To view failed sign-ins, navigate through the interface as follows.

  1. Open enterprise applications in Azure AD.

    azure debug 1
  2. Select your own application/APP.

    azure debug 2
  3. Open sign-in logs.

    azure debug 3

Keywords: