Azure-Samples / ms-identity-python-webapp

A Python web application calling Microsoft graph that is secured using the Microsoft identity platform
MIT License
293 stars 140 forks source link

verify id token validity [On Hold] #49

Closed idg-sam closed 1 year ago

idg-sam commented 3 years ago

new commit implements:

idg-sam commented 3 years ago

In this PR, once the user's token expires:

  1. The user is redirected to our-app/login. The user then clicks sign in to be redirected to AAD/authorize.
  2. At the AAD/authorize endpoint, one of two things happens: a. If the user has only have one signed-in account with AAD, it passes through silently b. If the user has multiple signed-in accounts on AAD, AAD will ask the user to to choose one

I'll check in a test that makes the ID token refresh seamless. I'll use the preferred_username claim as the login_hint.

rayluo commented 1 year ago

Thanks @idg-sam for the prototyping. We ended up choosing to move most of this kind of helper logic into a separate helper library, instead of adding more and more helpers into this sample. Closing this PR now.