Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When changing from UserNameToken to anonymous user, the UserNameToken stays associated with the session #1149

Closed
RS-trumpf opened this issue Oct 14, 2020 · 0 comments · Fixed by #1360
Assignees
Labels
bug A bug was identified and should be fixed.

Comments

@RS-trumpf
Copy link

When I log in as an anonymous user, then change the user to a user identified via UserNameToken (keeping the same session) and then switch back to the anonymous user, the session.UserToken still is the UserNameToken not an AnonymousUserToken.

Source is in SessionManager.ActivateSession() where session.ValidateBeforeActivate() returns null for the token if the session is already activated and the user is anonymous.

later on in this method session.Activate() skips calling UpdateUserIdentity() if the token is null.

The client (tested with UaExpert) signals "user change succeded".
This becomes critical when access levels are dependent on the logged in user and the server allows for multiple sessions with different users.

Not sure if simply checking the token for null and replacing it with a new AnonymousUserToken after calling session.ValidateBeforeActivate() is the correct fix.

@AlinMoldovean AlinMoldovean self-assigned this Apr 13, 2021
@AlinMoldovean AlinMoldovean added bug A bug was identified and should be fixed. and removed investigating labels Apr 13, 2021
AlinMoldovean added a commit to AlinMoldovean/UA-.NETStandard that referenced this issue Apr 13, 2021
…ixes OPCFoundation#1149

Check for unsupported UserIdentity type in ReferenceServer e.g. IssuedToken identity
AlinMoldovean added a commit that referenced this issue Apr 14, 2021
…ixes #1149 (#1360)

Check for unsupported UserIdentity type in ReferenceServer e.g. IssuedToken identity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug was identified and should be fixed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants