Azure-Samples / ms-identity-python-flask-webapp-authentication

This sample demonstrates a Python Flask webapp that signs in users in your tenant using Azure Active Directory
MIT License
54 stars 18 forks source link

Verify Token / Check User Logged in #9

Open NathanPrez opened 6 months ago

NathanPrez commented 6 months ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Log in microsoft account, close browser and reconnect

Any log messages given by the failure

N/A

Expected/desired behavior

Is there a method to verify whether a user is still logged in, via a request with their token details? If a user logs in with their microsoft account, closes the browser and then reconnects to the flask app, I can't find a method to verify if they're still logged in. Such that, they will be in a different state if they choose to 'stay logged in' or not. Whereas, the flask app's g.identity_context_data variable still sees them as logged in, regardless. So i was hoping to find a way to send a request to verify whether the user's token details are still valid / check if they're still logged in.

OS and Version?

N/A

Versions

N/A

Mention any other details that might be useful


Thanks! We'll be in touch soon.