Chapter 9. Tutorial: Configure Microsoft Entra ID as an identity provider


Configure Microsoft Entra ID (formerly Azure Active Directory) as the cluster identity provider to enable user authentication and group-based access control for your Red Hat OpenShift Service on AWS cluster by using OpenID Connect (OIDC).

This tutorial guides you to complete the following tasks:

  1. Register a new application in Entra ID for authentication.
  2. Configure the application registration in Entra ID to include optional and group claims in tokens.
  3. Configure the Red Hat OpenShift Service on AWS cluster to use Entra ID as the identity provider.
  4. Grant additional permissions to individual groups.

Register an application in Entra ID using your cluster OAuth callback URL to generate the credentials for cluster authentication.

Prerequisites

Procedure

  1. Create the cluster’s OAuth callback URL by changing the specified variables and running the following command:

    $ domain=$(rosa describe cluster -c <cluster_name> | grep "DNS" | grep -oE '\S+.openshiftapps.com')
    echo "OAuth callback URL: https://oauth.${domain}/oauth2callback/AAD"

    The AAD directory at the end of the OAuth callback URL must match the OAuth identity provider name that you will set up later in this process.

    Note

    Remember to save this callback URL; it will be required later in the process.

  2. Create the Entra ID application by logging in to the Azure portal, and select the App registrations blade. Then, select New registration to create a new application.

    Azure Portal - App registrations blade

  3. Name the application, for example openshift-auth.
  4. Select Web from the Redirect URI dropdown and enter the value of the OAuth callback URL you retrieved in the previous step.
  5. After providing the required information, click Register to create the application.

    Azure Portal - Register an application page

  6. Select the Certificates & secrets sub-blade and select New client secret.

    Azure Portal - Certificates and secrets page

  7. Complete the requested details and store the generated client secret value. This secret is required later in this process.

    Important

    After initial setup, you cannot see the client secret. If you did not record the client secret, you must generate a new one.

    Azure Portal - Add a Client Secret page

  8. Select the Overview sub-blade and note the Application (client) ID and Directory (tenant) ID. You will need these values in a future step.

    Azure Portal - Copy Client Secret page

The email and preferred_username Entra ID optional claims provide Red Hat OpenShift Service on AWS with the information it needs to create user accounts. Group claims enable group-based access control.

In addition to individual user authentication, Red Hat OpenShift Service on AWS provides group claim functionality. This functionality allows an OpenID Connect (OIDC) identity provider, such as Entra ID, to offer a user’s group membership for use within Red Hat OpenShift Service on AWS.

9.2.1. Configure optional claims in Entra ID

Configure the email and preferred_username optional claims in Entra ID so that Red Hat OpenShift Service on AWS can identify users during authentication.

Procedure

  1. Click the Token configuration sub-blade and click Add optional claim.

    Azure Portal - Add Optional Claims Page

  2. Select the ID radio button.

    Azure Portal - Add Optional Claims - Token Type

  3. Select the email claim checkbox.

    Azure Portal - Add Optional Claims - email

  4. Select the preferred_username claim checkbox. Then, click Add to configure the email and preferred_username claims your Entra ID application.

    Azure Portal - Add Optional Claims - preferred_username

  5. Follow the prompt in the dialog box to enable the necessary Microsoft Graph permissions.

    Azure Portal - Add Optional Claims - Graph Permissions Prompt

9.2.2. Configure group claims

Configure group claims in Entra ID to allow Red Hat OpenShift Service on AWS to manage user group memberships and enable group-based role bindings in the cluster.

Note

Configuring group claims is an optional step.

Procedure

  1. From the Token configuration sub-blade, click Add groups claim.

    Azure Portal - Add Groups Claim Page

  2. To configure group claims for your Entra ID application, select Security groups and then click Add.

    Note

    In this example, the group claim includes all of the security groups that a user is a member of. In a real production environment, ensure that the group claim only includes groups that apply to Red Hat OpenShift Service on AWS.

    Azure Portal - Edit Groups Claim Page

Use the ROSA command-line interface (CLI) (rosa) to configure the cluster’s OAuth provider to use Entra ID as its identity provider, enabling users to log in with their Microsoft credentials and optional group-based access control.

Procedure

  1. Create the variables necessary for the identity provider configuration by running the following command:

    $ CLUSTER_NAME=example-cluster
    $ IDP_NAME=AAD
    $ APP_ID=yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
    $ CLIENT_SECRET=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    $ TENANT_ID=zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz

    where:

    example-cluster
    Replace this with the name of your cluster.
    AAD
    Replace this value with the name you used in the OAuth callback URL that you generated earlier in this process.
    yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
    Replace this with the Application (client) ID.
    xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    Replace this with the Client Secret.
    zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz
    Replace this with the Directory (tenant) ID.
  2. Configure the cluster’s OAuth provider by running the following command. If you enabled group claims, ensure that you use the --group-claims groups argument.

    • If you enabled group claims, run the following command:

      $ rosa create idp \
      --cluster ${CLUSTER_NAME} \
      --type openid \
      --name ${IDP_NAME} \
      --client-id ${APP_ID} \
      --client-secret ${CLIENT_SECRET} \
      --issuer-url https://login.microsoftonline.com/${TENANT_ID}/v2.0 \
      --email-claims email \
      --name-claims name \
      --username-claims preferred_username \
      --extra-scopes email,profile \
      --groups-claims groups
    • If you did not enable group claims, run the following command:

      $ rosa create idp \
      --cluster ${CLUSTER_NAME} \
      --type openid \
      --name ${IDP_NAME} \
      --client-id ${APP_ID} \
      --client-secret ${CLIENT_SECRET} \
      --issuer-url https://login.microsoftonline.com/${TENANT_ID}/v2.0 \
      --email-claims email \
      --name-claims name \
      --username-claims preferred_username \
      --extra-scopes email,profile

      After a few minutes, the cluster authentication Operator reconciles your changes, and you can log in to the cluster by using Entra ID.

When you first log in, you might notice that you have very limited permissions. By default, Red Hat OpenShift Service on AWS only grants you the ability to create new projects, or namespaces, in the cluster. Other projects are restricted from view.

You must grant these additional abilities to individual users and groups.

Grant the cluster-admin role to individual Entra ID users so that they have full access and control over the cluster.

Procedure

  • Grant a user access to the cluster-admin role by running the following command:

    $ rosa grant user cluster-admin --user=<USERNAME> --cluster=${CLUSTER_NAME}

    where:

    <USERNAME>
    Provide the Entra ID username that you want to have cluster admin permissions.

When group claims are enabled, the cluster OAuth provider automatically creates or updates group memberships by using the group ID, but does not create RoleBindings or ClusterRoleBindings. You must create those bindings to grant group-based permissions.

To grant an automatically generated group access to the cluster-admin role, you must create a ClusterRoleBinding to the group ID.

Procedure

  • Create the ClusterRoleBinding by running the following command:

    $ oc create clusterrolebinding cluster-admin-group --clusterrole=cluster-admin --group=<GROUP_ID>

    where:

    <GROUP_ID>
    Specifies the Entra ID group ID that you want to have cluster admin permissions.

    Now, any user in the specified group automatically receives cluster-admin access.

Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat Documentation

Legal Notice

Theme

© 2026 Red Hat
Back to top