from @astegmaier
There seems to be some problems calling oidcSecurityService.getToken() and oidcSecurityService.getUserData() Specifically:
a. They will work fine immediately after the user logs in, but if you hard-refresh and call them again, they return nothing
b. the getUserData() method does not work unless you wait a while (~2-3 seconds) after oidcSecurityService.authorizedCallback() starts before calling it. I might be doing something wrong, but if there is some kind of asynchronous dependency for getUserData(), maybe it should return a promise or observable?
Both (a) and (b) appear to be unrelated to the storage used (I see the same problem if I turn off prerendering and use the default sessionStorage), so I can file a new issue with more details if you'd like.
@astegmaier yes, we have a problem here.
Fixing in the branch
https://github.com/damienbod/angular-auth-oidc-client/tree/dev-refresh
requires breaking changes, the IsAuthorization is now a subscription
@robisim74 @FabianGosebrink good? also will be a new Version 1.3.0
Most also fix the userData
user data is now fixed, uses a subscription instead of a event
Hi @damienbod ,
When I display data from an API that requires an OIDC authentication token, and I hit the browser's refresh button (F5), the angular-auth module doesn't send the Authorization token in the http request's header. Only a "soft" refresh (i.e. calling the http method to re-fetch the data without F5) works.
Would you have any idea of what's wrong?
Best,
Victor
Hi @vicver82 This should work now. Can you compare it to this solution:
Component which gets server data and refresh support:
https://github.com/damienbod/AspNet5IdentityServerAngularImplicitFlow/blob/npm-lib-test/src/AngularClient/angularApp/app/dataeventrecords/dataeventrecords-list.component.ts
Greetings Damien
Most helpful comment
@astegmaier yes, we have a problem here.