Azure active directory infinite redirect loop

Viewed 34

I have 2 azure accounts:

  1. my personal account
  2. my work account

  1. I created app registration on PERSONAL account:

https://docs.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.

Thanks for help guys. :)

2 Answers

Also another thing, you can't only use my.login (as you created user), you have to use my.login@mydirectory@onmicrosoft.com because this one is tricky, wihout @mydire... you will get sometimes bad password and sometimes redirect loop,..

Nah I figured 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://www.google.com/search?q=ms-identity-python-webapp+github&oq=ms-identity-python-webapp++github&aqs=chrome..69i57j0i13i30.1188j0j7&sourceid=chrome&ie=UTF-8

To run this you have to add values to config and you have to add because in my case it tried to create this folder in pycharm c folder, but it was not allowed.

SESSION_FILE_DIR = os.path.normpath(os.path.abspath(file) + "/../tokens/")

Related