I need a way to check if the user is signed in to the identity provider in the background.
We have a community that users interact with via an Angular app on a Visualforce page. We have it set up so they can log in via username\password or SSO from our identity provider.
If the user is logged in I can tell and then change the UI to display their name instead of the Login button.
However, if the user is already logged in to the identity provider, I can't really tell in Salesforce that they're logged in, because they have no active session yet.
If the user is already logged in to the identity provider, we would like to silently log them in to our community.
Now, I could make a call to
Auth.AuthConfiguration.getSamlSsoUrl(communityUrl, startUrl, samlId) and return a
PageReference and that will log the user in. But that is a bad user experience because it removes them from the page they want to view.
So how can I send a SAML request to the identity provider in the background, just to see if the user is logged in? And then silently log them in?