Describe the bug
If you set up Front Door (or L7 Reverse proxy) in front of Static Web App and add Azure AD or OpenID Connect authentication after adding a custom domain to Front Door, the redirection will not be done on the custom domain.
It looks to me like a common problem of not handling X-Forwarded-Host correctly.

This can be handled by setting forwardProxy in httpSettings for Easy Auth in the App Service, but cannot be avoided in Static Web Apps because the setting is not provided.
https://docs.microsoft.com/en-us/azure/templates/microsoft.web/sites/config-authsettingsv2?tabs=json#httpsettings-object
To Reproduce
Steps to reproduce the behavior:
- Create Static Web App
- Create a Front Door and add Static Web App as a backend
- Add custom domain to Front Door
- Setup SWA custom authentication for custom domain
- Access to
https://customdomain/.auth/login/***
Expected behavior
The custom domain being accessed (the custom domain set in Front Door) is maintained even when redirected to the IdP.
Describe the bug
If you set up Front Door (or L7 Reverse proxy) in front of Static Web App and add Azure AD or OpenID Connect authentication after adding a custom domain to Front Door, the redirection will not be done on the custom domain.
It looks to me like a common problem of not handling
X-Forwarded-Hostcorrectly.This can be handled by setting
forwardProxyin httpSettings for Easy Auth in the App Service, but cannot be avoided in Static Web Apps because the setting is not provided.https://docs.microsoft.com/en-us/azure/templates/microsoft.web/sites/config-authsettingsv2?tabs=json#httpsettings-object
To Reproduce
Steps to reproduce the behavior:
https://customdomain/.auth/login/***Expected behavior
The custom domain being accessed (the custom domain set in Front Door) is maintained even when redirected to the IdP.