A cloud-based identity and access management service for securing user authentication and resource access
Thank you for providing the additional details, they're very helpful.
Since:
- Entra ID authentication completes successfully (HTTP 200)
- The authorization request reaches Microsoft Entra and the user authenticates successfully
- The built-in Entra provider works on the same Static Web App
- /.auth/login/aad/callback returns 401 before issuing the authentication cookie
- /.auth/me returns "clientPrincipal": null
this indicates the failure is likely occurring during the authorization code/token exchange performed by the Static Web Apps authentication service, rather than within Microsoft Entra ID itself.
A few thoughts:
- The Free Trial subscription should not prevent custom identity providers. Custom authentication is a feature of the Standard Static Web Apps plan, not the Azure subscription type itself. Since you've confirmed the app is running on Standard SKU, the trial subscription should not be the limiting factor.
- Unfortunately, there is no documented mechanism to enable verbose diagnostics for the managed /.auth endpoints. The authentication middleware is platform-managed, and Application Insights does not expose its internal token exchange or validation steps.
- Given that the built-in provider succeeds while the custom provider fails using the same tenant, this may indicate either:
- a platform regression affecting the custom azureActiveDirectory provider, or
- an issue with the authentication service handling the custom provider configuration.
At this point, I'd recommend opening an Azure Support request and including:
- The Static Web App resource ID
- Subscription ID
- Region
- Timestamp (UTC) of a failed login
- The x-ms-request-id, x-ms-correlation-request-id, or any similar response headers from the failed POST /.auth/login/aad/callback
- Your staticwebapp.config.json (with the client secret removed)
Those details allow the Azure Static Web Apps team to inspect the backend authentication logs, which aren't exposed to customers.
One additional question: Does this behavior reproduce in a brand-new Standard Static Web App with a minimal staticwebapp.config.json and a newly created Entra app registration? If it does, that would further point to a platform-side issue rather than a configuration problem.
This additional information should help determine whether this is an environmental configuration issue or something the Azure Static Web Apps engineering team needs to investigate.
Please "Accept the Answer" if this information helped you. This will help us and others in the community as well.Thank you for providing the additional details—they're very helpful.
Since:
- Entra ID authentication completes successfully (HTTP 200)
- The authorization request reaches Microsoft Entra and the user authenticates successfully
- The built-in Entra provider works on the same Static Web App
- /.auth/login/aad/callback returns 401 before issuing the authentication cookie
- /.auth/me returns "clientPrincipal": null
this indicates the failure is likely occurring during the authorization code/token exchange performed by the Static Web Apps authentication service, rather than within Microsoft Entra ID itself.
A few thoughts:
- The Free Trial subscription should not prevent custom identity providers. Custom authentication is a feature of the Standard Static Web Apps plan, not the Azure subscription type itself. Since you've confirmed the app is running on Standard SKU, the trial subscription should not be the limiting factor.
- Unfortunately, there is no documented mechanism to enable verbose diagnostics for the managed /.auth endpoints. The authentication middleware is platform-managed, and Application Insights does not expose its internal token exchange or validation steps.
- Given that the built-in provider succeeds while the custom provider fails using the same tenant, this may indicate either:
- a platform regression affecting the custom azureActiveDirectory provider, or
- an issue with the authentication service handling the custom provider configuration.
At this point, I'd recommend opening an Azure Support request and including:
- The Static Web App resource ID
- Subscription ID
- Region
- Timestamp (UTC) of a failed login
- The x-ms-request-id, x-ms-correlation-request-id, or any similar response headers from the failed POST /.auth/login/aad/callback
- Your staticwebapp.config.json (with the client secret removed)
Those details allow the Azure Static Web Apps team to inspect the backend authentication logs, which aren't exposed to customers.
One additional question: Does this behavior reproduce in a brand-new Standard Static Web App with a minimal staticwebapp.config.json and a newly created Entra app registration? If it does, that would further point to a platform-side issue rather than a configuration problem.
This additional information should help determine whether this is an environmental configuration issue or something the Azure Static Web Apps engineering team needs to investigate.
Please "Accept the Answer" if this information helped you. This will help us and others in the community as well.