Reputation: 627
I successfully host an app service on azure (ASP.Net MVC 5). There are some areas that are publically accessible (...mywebsite). To access the admin area (...mywebsite/admin) a user needs needs to authorize which is done via Azure AD and the [Authorize]
attribute on all controller actions.
Everything worked perfectly via http.
Now in Azure I added a certificate to the app service and enabled „always use https“ which means every user accessing the app service via http gets redirected to https (http://mywebsite -> https://mywebsite).
Fine, it also works. But: when I try to access the admin area, after the login page from Microsoft where I enter my username and pwd it doesn’t get redirected to https://mywebsite/admin (which I expected) but back to the base url https://mywebsite.
Seems that I am missing something...
Upvotes: 0
Views: 675
Reputation: 5496
This will be due to your web application's Azure AD registration containing the https://mywebsite/ as the Return URL and not the https://mywebsite/admin. You can either add your admin site as another return URL or use some code to determine the location to return to after login. See How to set Azure Authentication custom login return url?
Upvotes: 1