Equivalent functionality to webAuth.checkSession from auth0.js in auth0-angular for SSO

  • Which SDK this is regarding: - auth0-angular, auth0.js
  • SDK Version: - auth0-angular@1.40.0, auth0.js@9.8.2
  • Platform Version: - Node 10.19.0


I was playing around with this repo and my angular 10 app. I was able to get the samples from the repo to work and they work nicely. When I reviewed the code, I noticed there was webAuth.checkSession method that was hitting back to the decentralized auth0 api. I think this is really good for what I am trying to achieve for SSO. I have the following question. What is equivalent of doing the webAuth.checkSession in auth0-angular library? I’m trying to replicate the same SSO experience.

Hi @mohammadz, thanks for your patience here. There is no equivalent currently as the auth0-angular package is designed to completely manage this for you. It uses the auth0-spa-js SDK under the hood (which does have checkSession functionality) when the SDK initializes, but this in turn calls getTokenSilently under the hood to manage the refresh of ID/access tokens and rehydrate the user state.

In short, you shouldn’t need to call this yourself when using auth0-angular.

Hope this helps!

Hi thanks for the answer.

No worries, we’re here for you!