Question about PWA when user is offline
See original GitHub issueLibrary
-
msal@1.x.x
or@azure/msal@1.x.x
-
@azure/msal-browser@2.x.x
-
@azure/msal-node@1.x.x
-
@azure/msal-react@1.x.x
-
@azure/msal-angular@0.x.x
-
@azure/msal-angular@1.x.x
-
@azure/msal-angular@2.x.x
-
@azure/msal-angularjs@1.x.x
Description
Hello,
We are hoping to convert our angular application into a PWA so that we can offer some of the application up to a user that loses internet connection. The more I read about how authentication works, the more my guess is confirmed that without internet, you really can’t trust who the user is in the application.
But I’d like to ask the question: will this library let me have certain feature modules that don’t require authentication to be able to be used longer than the token expiration normally allows them to? In other words, it seems like this library automatically tries to refresh tokens behind the scenes, and I’d imagine those would fail without an internet connection. Do those token refreshes only happen when a resource is requested that is in the protected resource map? Or will the token refresh happen on its own when the token expires?
If we prevent making http calls to resources that are protected, can the user, even if their token is expired, still navigate the rest of the site as long as they don’t try to make calls to protected resources?
I’m trying to figure out if this is even going to be possible while using this library, and I’m looking through the source code. I feel like it’ll be possible, but I was hoping to get a response from one of the maintainers in regards to their opinion on how to go about this.
Source
- Internal (Microsoft)
- Customer request
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (6 by maintainers)
Top GitHub Comments
Sorry, to be clear, MSAL Angular v1 invokes
acquireTokenSilent
with the client id scope in the MSAL Guard, which is how an ID token is acquired in MSAL.js v1.The MSAL Guard for MSAL Angular v2 only looks at the cached accounts, and does not call acquireTokenSilent (and thus will not potentially make a network request).
And yes, we would recommend moving to MSAL Angular v2, especially if you are upgrading your version of Angular. We’ll have more details on GA soon.
jakehockey10 This issue has been automatically marked as stale because it is marked as requiring author feedback but has not had any activity for 5 days. If your issue has not been resolved please leave a comment to keep this open. It will be closed in 7 days if it remains stale.