Two different AuthenticationProperties types
khellang opened this issue · 8 comments
Why is there two different AuthenticationProperties types in this repository?
Why doesn't Microsoft.AspNetCore.Authentication.Abstractions use the one from Microsoft.AspNetCore.Http.Abstractions?
My guess is that the type in Microsoft.AspNetCore.Http.Authentication is for the 1.0 auth stack.
@HaoK ?
Everything in Http.Authentication was depreciated and/or moved in 2.0.
Everything in Http.Authentication was depreciated and/or moved in 2.0.
Except they're not. Only AuthenticationManager is deprecated.
@khellang Only AuthenticationManager has the Obsolete attribute. Those types are considered deprecated. I'm not sure why we didn't mark them as such.
Those types are considered deprecated. I'm not sure why we didn't mark them as such.
Right, but unfortunately, there's no tooling (yet?) that can read the ASP.NET team's minds 😉
It's kinda confusing when you end up importing the wrong namespace/type and there's nothing telling you that it's obsolete 😝
We settled on obsoleting all the main entry points: (#863 (comment)).
So there should be no way to actually use the old AuthenticationProperties, but yeah there would be no warning if you were only using the properties type. But you would get a compile warning/error as soon as you tried to actually do anything with it.
I originally pointed this out on chat; thanks for opening an issue about it @khellang.
The reason why I encountered this is that while migrating to 2.0, I still had a using on Microsoft.AspNetCore.Http.Authentication inside my code. So when I created AuthenticationProperties somewhere, I got an error about the ambiguous type which I was not able to resolve at that time without actually knowing which type is used and which isn’t (I only was able to do so later when that object was passed to SignOutAsync).
If we still want to keep the obsolete AuthenticationManager around for now, maybe we could at least change the AuthenticationProperties type it uses to the new type, so that we simply no longer have two identical types in the framework?
This issue was moved to dotnet/aspnetcore#2681