In my application, I have Azure AD authentication OpenId connect authentication scheme, and my app is running behind the application gateway. I am facing an issue while authenticating from the application gateway URL which is public and my backend application URL is restricted for public use. For ex. this is my application gateway URL example.com and this is for backend application example.azurewebsites.net.
When I hit the example.com URL in the browser I redirected to the Microsoft site for the login then I log in after successful login I am redirected to the example.com/sign-oidc URL, and that's where the problem starts. When I saw the response header of the example.com/sign-oidc in the network tab of the browser, I got this warning message "This Set-Cookie was blocked because its Domain attribute is invalid with regards to the current host URL" for the Set-Cookie header, its domain attribute was set to example.azurewebsites.net. I think this should be the application gateway's URL which is example.com.
This issue preventing me to log into the system.