question

amol-6229 avatar image
0 Votes"
amol-6229 asked vipulsparsh-MSFT commented

This Set-Cookie was blocked because its Domain attribute is invalid with regards to the current host URL

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.

Many thanks,

azure-active-directoryazure-application-gateway
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@amol-6229 I wanted to follow up and know if the below responses helped in answering your query. If it did, please do not forget to accept the appropriate response as Answer.

0 Votes 0 ·

1 Answer

vipulsparsh-MSFT avatar image
0 Votes"
vipulsparsh-MSFT answered vipulsparsh-MSFT edited

@amol-6229 Apologies for delay on this , the scenario you are in might be an expected one. This needs some configuration changes at the Application gateway level. You can go through this to figure out what you need : https://docs.microsoft.com/en-us/azure/application-gateway/rewrite-http-headers-url#modify-a-redirection-url



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.