How to tell if a user has an active Azure session, in html page, before SSO?

十年热恋 提交于 2021-02-08 11:39:40

问题


I'm trying to create an HTML page, and a part of it is to check if a user has an active Azure AD logged in session. If so then certain elements of the page would change.

The IdP and SP are setup correctly, and SSO works, this is a separate page from both of them.

This page is here before the user is redirected to the service provider. I just can't figure out how to do this! Is there any way to do it without redirecting the user off the page, maybe using JS?


回答1:


After passing the aad authentication, you will get the access token.

You want to determine whether the azure session is valid before sso authentication. Then in your html page, if you include access token information, you can judge whether the tokens are valid and expired.

If the html page does not contain token information, it is recommended to use ropc flow to obtain the access token again. If you have to judge whether it has expired, it is recommended to store the information when logging in and verify it next time you log in.



来源:https://stackoverflow.com/questions/64288639/how-to-tell-if-a-user-has-an-active-azure-session-in-html-page-before-sso

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!