Azure-Samples / ms-identity-python-webapp

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

go to the requested url rather than home page #22

Closed santhoshbomma9 closed 4 years ago

santhoshbomma9 commented 4 years ago

Hi @rayluo Is there a way to implement this? I am unable to store the requested url when the login flow happens and it just keeps going to the home/main page.

rayluo commented 4 years ago

Understood. While we may consider to add this into our sample, this is largely a topic of web framework usage. The following approach would probably work (I haven't tested it, though):

You can try to store the requested url into session, BEFORE the login flow. And then, after the successful login, in the home i.e. /index page (at line 17.5), you can add a redirect based on the stored url in session.

santhoshbomma9 commented 4 years ago

Sure, thanks @rayluo, didnt want to use the session but seems like the only option. I will try that.

rayluo commented 4 years ago

It is not the only option, but it is probably the easiest/cheapest option, given that you get the session functionality for free, and we are already using it for other things anyway.

santhoshbomma9 commented 4 years ago

yes true! Thanks @rayluo !