Describe the bug
If autoUserinfo is true, everything is as excpected:
If autoUserInfo is false, the behavior of userData$ Observable becomes inconsistent:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
If autoUserInfo is false, userData$ should fire in the same situations as it does with autoUserInfo = true:
If you dont't agree with this, it should at least be documented, what behavior to expect from userData$, if autoUserInfo is false.
Hi @stefanocke Thanks for the issue. Yes this needs to be improved. The event should fire after each refresh. Just need to think about the other times the event fires.
@stefanocke thanks for reporting. Will release a fix in version 11.6.3 Event will fire now in a refresh if the autoUserInfo is false and the renewUserInfoAfterTokenRenew is true.
@damienbod , thanks a lot for looking into this issue. Have you also considered to fire null / call resetUserDataInStore in the error case (token refresh fails, for example with "login_required")?
need to think about this as well. Not sure of how to solve this yet , trying to reproduce the null case
Will keep this open until the null issue is solved.
this issue is related
https://github.com/damienbod/angular-auth-oidc-client/issues/972
Thanks
@stefanocke I think this is fixed now with the release 11.6.3. Can you re-open if the null case can be re-reproduced?
I this this witht he httpconfig examples and small changes to this
Greetings Damein and thanks for the issue.
@damienbod thank you again.
Unfortunately I cannot fully understand your last comment. Did you try to say that you could not reproduce the null case with httpconfig example?
If so, I will of course check again.
Hi @stefanocke maybe it's just me not understanding :)
I odn't see what I should do here because when the login_error happens, the lib is usually setup to handle this and reset so the user data is also reset. I don't see why adding an extra event would help help.
Good/bad?
Greetings Damien
Hi @damienbod , let me try to give you some more details, since I think there was something missing in my description:
At first, I think you cannot reproduce my case, since you have startCheckSession set tor true in your example. So, the session check might be the one, that resets the user. However: my auth server does not suppert OIDC Session Management Specification. So, in my case startCheckSession is false.
That means, in case of logout (in a different OAuth client or in the auth server), the session check will not kick in in my case. Instead, the user will be kept logged in until the next token refresh.
Then, the "login_error" happens.
And then, we have the inconsistency that I described:
(anonymous) (app.component.ts:16)
__tryOrUnsub (Subscriber.js:183)
...
next (BehaviorSubject.js:30)
resetUserDataInStore (angular-auth-oidc-client.js:1621)
resetAuthorizationData (angular-auth-oidc-client.js:1691)
codeFlowCallbackSilentRenewIframe (angular-auth-oidc-client.js:2692)
silentRenewEventHandler (angular-auth-oidc-client.js:2726)
Ah thanks, yes this is no longer required as the user data is always set now.