问题
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