Reference: (Apple) Configuring Identity Providers to use with Device Management
-
OpenID Connect (OIDC) compliant identity provider:
-
auth0
-
Entra ID
-
Okta
-
OneLogin
Note:The identity provider administrator must have access to manage user roles, user permissions, user mappings, and user attributes; configure applications; and assign users to applications. Refer to your identity provider documentation to understand the required roles and permissions.
For example, the Okta App Admin role provides the needed permissions: Manage Profile Editor, Manage Profile Mappings, View applications or application instances, Add and configure applications, Assign user access to applications, and Create and modify an OIDC App.
The IdP must have the application configured as a Single Page Application (SPA) using Proof Key for Code Exchange (PKCE).
-
Before you begin
Before you configure an IdP, you must configure an Apple Push Certificate to use with Device Management. For more information, see (Apple) Configure an Apple Push Certificate to use with Device Management. After you configure the push certificate, copy the Redirect URI for your Device Management instance:
From the Main menu, go to . Click Settings and then click IDP Configuration. Copy the Redirect URI.
OIDC requirements
The IdP application must meet the following requirements to integrate with Device Management:
-
OAuth flow: Authorization Code with Proof Key for Code Exchange (PKCE). Configure the application as a public client (Single Page Application) with no client secret.
-
Scopes: Grant the openid, email, and profile scopes to the application.
-
ID token claims: The ID token must include the email claim, which Device Management uses as the user identity on the device. The name claim is optional. If the ID token does not include the email claim, Device Management retrieves the email from the IdP UserInfo endpoint using the access token.
-
Audience: The aud claim in the token must contain either the Issuer URL or the Client ID that is configured in Device Management.
-
Issuer URL and discovery: Device Management retrieves the IdP configuration from {IssuerURL}/.well-known/openid-configuration and verifies that the issuer field in the response matches the Issuer URL configured in Device Management exactly. The trailing slash, scheme, and path must all match. A mismatch is the most common cause of the error getting oauth2 endpoint error during enrollment.
-
Cross-origin resource sharing (CORS): The enrollment flow runs in the browser, so the IdP token endpoint must allow cross-origin requests from the Device Management Redirect URI host. For most IdPs, the token endpoint is configured for CORS automatically when you select the Single Page Application application type. If the IdP does not configure CORS automatically, configure the token endpoint to return the following headers:
-
Access-Control-Allow-Origin: <Redirect URI host>
-
Access-Control-Allow-Methods: POST
-
Access-Control-Allow-Headers: Content-Type
-
auth0
For more information about configuring auth0, see auth0 documentation: Applications in Auth0.
Microsoft Entra ID
For more information about configuring Microsoft Entra ID, see Microsoft Entra Documentation: Single-page application: Code configuration.
Okta
For more information about configuring Okta, see Okta documentation: Create OpenID Connect app integrations.
OneLogin
For more information about configuring OneLogin, see OneLogin Docs: OpenID Connect (OIDC) Custom Connector.
Troubleshooting
Error: error getting oauth2 endpoint
- Cause
-
During enrollment, Device Management could not match the issuer field returned by the IdP discovery document to the Issuer URL configured in Device Management. The most common cause is a difference in the trailing slash, scheme, or path between the two values.
- Solution
-
Compare the Issuer URL configured in Device Management against the issuer field returned by the IdP discovery document, and update the Device Management setting to match exactly.
-
In a browser, open {IssuerURL}/.well-known/openid-configuration and note the value of the issuer field in the response.
-
From the Main menu, go to . Click Settings
and then click IDP Configuration.
-
Verify that the Issuer value matches the issuer field from the discovery document exactly, including trailing slash, scheme, and path. Update the value if necessary and click Apply.
-
iOS, iPad, iPadOS, iPhone, Mac, and macOS are trademarks of Apple Inc., and registered in the U.S. and other countries and regions.
Android, ChromeOS, and Google are trademarks of Google LLC.