-
Notifications
You must be signed in to change notification settings - Fork 176
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
Fixed static currentPrincipal (issue #32) #33
base: develop
Are you sure you want to change the base?
Conversation
I have tried to reproduce the issue using my own demo (with the .Net CAS client v1.0.2): https://github.com/leleuj/dotnet-cas-client-demo, but unsuccessfully. I open two browsers and authenticates in each of them with different identities and I do have two different identities. Can you check on your side on give me more details? Thanks |
Since the backing variable is [ThreadStatic], it might be required for both requests to be served by the same webserver thread. This behaviour will depend on whether you are using VS's internal server, IIS, etc. Honestly I'm not sure of the conditions to make this happen, only that it happened consistently in our staging environment (web app hosted in IIS7), and that this diff solved it. |
OK. So if I want to reproduce it, I should simulate some load to make authentications on the same request, right? |
Maybe... It may also be that the issue only appears on some web servers (such as IIS but not visual studio's integrated one). |
Should user principal objects even be static? |
Yes, I have the same feeling: I would have expected the principal to be stored in the web session like in the Java or PHP CAS client for example. |
This article was a good read : http://www.lhotka.net/weblog/ASPNETThreadSwitching.aspx I feel like with this PR the code is OK, maybe it would be a good idea to set |
The purpose of that field is similar to that of Looking at b345f1f, where the field was introduced, we should probably just remove the field and use |
Avoids multiple users in ASP.NET application sharing a single identity.