brockallen / BrockAllen.MembershipReboot

MembershipReboot is a user identity management and authentication library.
Other
742 stars 238 forks source link

HttpContext.User.HasUserID() is false, but HttpContext.User.Identity seems fine #567

Closed sheam closed 8 years ago

sheam commented 9 years ago

Hello,

I am getting some weirdness in my MR implementation. The root of my issue seems to be that after a long time (probably when my login expires) I am getting a situation where HttpContext.User.HasUserID() is false, but HttpContext.User.Identity.Name has correct login name, and HttpContext.User.Identity.IsAuthenticated is true.

Is this normal behaviour?

~Shea M.

brockallen commented 9 years ago

Odd. Not sure, someone will have to debug it :)

sheam commented 9 years ago

If it helps, if I do a logout, then login again it is fine.

I am just using the nuget package, I could download source, and have a look, which projects would I need to reference? But I need to know what is expected behavior. I am assuming that HasUserID should be returning false if Identity.Name has a value and Identity.IsAuthenticated is true? Is it just a cookie not being wiped out?

sheam commented 8 years ago

Sorry, I am not meaning to say the problem lies in MR, nor am I saying I want someone else to solve my issue. But in order for me to do anything, I need some clarification on the MembershipReboot's helper function HttpContext.User.HasUserID() .

I'll try and be more clear: Should it ever return false when HttpContext.User.Identity.Name has a valid value?

sheam commented 8 years ago

Hmmm, digging a little deeper, and looking at cookies, I did not have a FedAuth cookie. But I did have a ASP_AUTH cookie. Not sure where this cookie came from, but it seems to be the reason that HttpContext.User.Identity.Name has a value when it shouldn't and also why Request.IsAuthenticated is returning true when it should not.

Must be a cross contamination of cookies from another MVC project I am working on and debugging on locatlhost...

brockallen commented 8 years ago

So all set now? We can close this?

sheam commented 8 years ago

Yes, go ahead and close it.