In my Django web application, I need to enable SSO - single tenant - Internal to the organization.
Based on ref tutorial: link I was able to copy-paste required code snippets in views.py, urls.py.
I also created an oauth_settings.yml file-
app_id: {app id}
app_secret: {app secret}
redirect: "http://localhost:8000/callback"
scopes:
- user.read
authority: "https://login.microsoftonline.com/{tenant}"
Yet every time after I submit the O365 credentials, I am facing the same /callback error :-
I have identified the issue to be in 'auth_flow' variable which holds entire flow dict. data which is reflected earlier, but fails to be saved in the request.session.
Please guide what exactly may be the issue at hand. Thanks.
According to my test, when we were browsing to http://127.0.0.1:8000 instead of http://localhost:8000, we got the error. Because the browser does not store session and set cookie when using IP address. So please use http://localhost:8000. to access project when you develop the project on your local machine. For more details, please refer to the Github issue