Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Two different AuthenticationProperties types #966

Closed
khellang opened this issue Nov 13, 2017 · 8 comments
Closed

Two different AuthenticationProperties types #966

khellang opened this issue Nov 13, 2017 · 8 comments

Comments

@khellang
Copy link
Contributor

khellang commented Nov 13, 2017

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?

@davidfowl
Copy link
Member

davidfowl commented Nov 13, 2017

My guess is that the type in Microsoft.AspNetCore.Http.Authentication is for the 1.0 auth stack.

@HaoK ?

@Tratcher
Copy link
Member

Tratcher commented Nov 13, 2017

Everything in Http.Authentication was depreciated and/or moved in 2.0.

@khellang
Copy link
Contributor Author

Everything in Http.Authentication was depreciated and/or moved in 2.0.

Except they're not. Only AuthenticationManager is deprecated.

@davidfowl
Copy link
Member

@khellang Only AuthenticationManager has the Obsolete attribute. Those types are considered deprecated. I'm not sure why we didn't mark them as such.

@khellang
Copy link
Contributor Author

khellang commented Nov 13, 2017

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 😝

@HaoK
Copy link
Member

HaoK commented Nov 13, 2017

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.

@poke
Copy link
Contributor

poke commented Nov 14, 2017

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?

@aspnet-hello
Copy link

This issue was moved to dotnet/aspnetcore#2681

@aspnet aspnet locked and limited conversation to collaborators Jan 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants