Search code examples
azureazure-active-directory

Azure active directory infinite redirect loop


I have 2 azure accounts:

  1. my personal account
  2. my work account

  1. I created app registration on PERSONAL account:

https://learn.microsoft.com/en-us/azure/app-service/configure-authentication-provider-aad#-option-2-use-an-existing-registration-created-separately

  1. I created python web app (with default microsoft hello screen, no code) on WORK account and registered authentication with Microsoft AD. (with client ID and secret form personal account), also with return URL, (tried web and single page)

Now, when I enter web app URL I got redirected on login.microsoft,... but here comes problem, after I login (with my personal account) application will request me again which account I want, and again and again ang again,... infinite loop.

Do someone has similar experience?

I checked something on stackoverflow, but there are some libs (really old) in c# which handles it, but I don't have c# application and even I have no code on server. This should be no problem, because you can also deploy static web app via ftp on web app, and like half of year ago it was working.


Solution

  • I figured it out, I didn't copied SECRET VALUE, but I copied SECRET KEY, I figured out this thanks to this mdal example project, which warned me about invalid secret:

    https://github.com/Azure-Samples/ms-identity-python-webapp