Configure Microsoft Entra ID as a Custom OIDC Identity Provider in Okta
Last Updated:
Overview
The built-in Okta Microsoft Identity Provider (IdP) uses the /common endpoint, which allows authentication from any Microsoft Entra ID tenant and personal Microsoft accounts. When administrators use the built-in Microsoft IdP, unauthorized users with personal Microsoft accounts or external Entra ID accounts successfully authenticate into the Okta environment. To restrict authentication to a specific Entra ID tenant, administrators must register an application in Microsoft Entra ID and configure a Custom OpenID Connect (OIDC) IdP in Okta.
Applies To
- Okta Identity Engine (OIE)
- Okta Classic Engine
- Microsoft Identity Provider
- Custom OpenID Connect (OIDC) Identity Provider
- Microsoft Entra ID
Cause
The built-in Microsoft IdP in Okta sets the authorization endpoint to https://login.microsoftonline.com/common. The /common endpoint inherently accepts credentials from any Microsoft Entra ID tenant and personal Microsoft accounts, which prevents administrators from restricting access to a single tenant.
Solution
How is the application registered in Microsoft Entra ID?
Register a new application in the Microsoft Entra ID portal to generate the necessary credentials and restrict access to a single tenant.
- Sign in to the Microsoft Azure portal.
- Navigate to Microsoft Entra ID, and then select App registrations.
- Select New registration.
- Enter a name for the application.
- Choose Accounts in this organizational directory only (Single tenant) under the Supported account types section.
- Select Web from the Redirect URI dropdown menu, and then enter the Okta callback URL (e.g.,
https://<okta-domain>.okta.com/oauth2/v1/authorize/callback). - Select Register.
Generate the client secret and gather the endpoint URLs.
Obtain the Application ID, generate a Client Secret, and locate the OpenID Connect endpoints required for the Okta configuration.
- Navigate to the Overview page of the newly registered application.
- Copy and save the Application (client) ID and the Directory (tenant) ID.
- Select Endpoints from the top menu.
- Copy and save the OpenID Connect metadata document URL, the OAuth 2.0 authorization endpoint (v2.0), and the OAuth 2.0 token endpoint (v2.0).
- Navigate to Certificates & secrets in the left menu.
- Select New client secret.
- Enter a description, choose an expiration period, and then select Add.
- Copy and save the Value of the client secret immediately. NOTE: Microsoft Entra ID hides the client secret value after the user navigates away from the page.
How is the Custom OIDC Identity Provider configured in Okta?
Create a Custom OIDC IdP in the Okta Admin Console using the gathered Microsoft Entra ID credentials and endpoints.
- Navigate to Security, and then select Identity Providers in the Okta Admin Console.
- Select Add Identity Provider, and then choose Add OpenID Connect IdP.
- Enter a name for the Identity Provider.
- Enter the Application (client) ID into the Client ID field.
- Enter the saved client secret into the Client Secret field.
- Enter the OAuth 2.0 authorization endpoint (v2.0) into the Authorization endpoint field.
- Enter the OAuth 2.0 token endpoint (v2.0) into the Token endpoint field.
- Enter
https://login.microsoftonline.com/<tenant-id>/v2.0into the Issuer URI field, replacing<tenant-id>with the saved Directory (tenant) ID. - Enter
https://login.microsoftonline.com/<tenant-id>/discovery/v2.0/keysinto the JWKS endpoint field, replacing<tenant-id>with the saved Directory (tenant) ID. - Select Finish to save the configuration.
