ASP.Net redirecting to local host after authentication

后端 未结 5 692
萌比男神i
萌比男神i 2020-12-18 12:45

I just created a webform that is hosted in my Azure subscription. I set it up with authenication via my works Azure directory for authenticating users. In debug this works f

5条回答
  •  醉话见心
    2020-12-18 13:11

    I had this issue when I switched an app from our company Azure over to a customer's Azure. In my case I'd forgotten to update the ida:ClientId, ida:AADInstance and ida:TenantId, which then meant that the value I'd set for ida:PostLogoutRedirectUri was ignored (I think) and instead my app redirected to localhost.

    Once I changed those ida values to the values from the app settings and subscriptions settings on our customer's Azure it all worked as expected.

    It took a while to track down all the values in Azure portal as they are all called something different, or aren't named at all:

    • ClientId can be found at Azure Active Directory > App Registrations > YourAppName. It's called 'Application ID' in Azure
    • Domain can be found on Azure Active Directory > Overview. It's currently in the top left in the format somename.onmicrosoft.com
    • TenantId this is the Azure AD instance ID, get that from Azure Active Directory > Properties and then it's called 'Directory ID'

    I spent a lot of time trying to work out where the localhost port that was being redirected to was in the code, but it simply isn't there as far as I can see, so I have no idea how Azure was choosing what localhost address to redirect to!

提交回复
热议问题