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

Revisit identity factoring and react to Auth 2.0 #651

Closed
prasannavl opened this issue Nov 27, 2015 · 14 comments
Closed

Revisit identity factoring and react to Auth 2.0 #651

prasannavl opened this issue Nov 27, 2015 · 14 comments

Comments

@prasannavl
Copy link
Contributor

The SignInManager currently is too coupled to cookies. It should ideally be able to switch methods for persistence. Currently, there's no way to use the SignInManager and enable a simple token style authentication using either the standard Bearer tokens, or a custom headers which are required for pure API services.

Either that, or the SignInManager should be moved into a namespace that emphasizes that most of its functionality only work with cookies. Shouldn't be under a very generic purview.

@prasannavl prasannavl changed the title SignInManager too tied to cookies - Adopt hooks for web API. Decouple SignInManager from cookies Nov 28, 2015
@rustd rustd added this to the Backlog milestone Nov 30, 2015
@rustd
Copy link

rustd commented Nov 30, 2015

So far Identity is based on cookies only. We can consider this in a future release.

@alexsandro-xpt
Copy link

There a substitute for Identity to work with Bearer tokens?

@brockallen
Copy link

So far Identity is based on cookies only. We can consider this in a future release.

Sorry Pranav, but this concept makes no sense. Cookies authenticate users in a browser and are unrelated to ASP.NET Identity. An identity management library (such as ASP.NET Identity) is what stores and validates users credentials. It's really independent of the consuming application. These two "things" are separate because you don't have to use them together. Conflating cookie authentication and identity management is not helpful.

I suspect it was easier to just put the SignInManager into the same assembly as the UserManager, and thus say "we are based on cookies", but it's a disingenuous answer. The part that helps with issuing cookies should be in its own assembly. The core of ASP.NET Identity should not have a dependency on HTTP.

The separation will be important once you consider other types of authentication, such as OAuth2 (and not the OAuth2 authentication middleware that's in ASP.NET 5).

Related: the brute-force code in the SignInManager should be in the core and separate from the code that manages the cookies. You will want those features from the OAuth2 endpoints.

@HaoK
Copy link
Member

HaoK commented Dec 16, 2015

FWIW these were split apart in 2.0

@HaoK
Copy link
Member

HaoK commented Jun 2, 2016

Moving milestone for consideration

@joshgarwood
Copy link

Is this still not finished? Which is to say, are we not able to use signInManager if we're using JwtAuthentication? I'm using .Net Core and jwt tokens, but would also like to leverage signInManager... is this possible yet? Or is there another recommendation you could make?

@divega divega modified the milestones: 1.1.0, 1.1.0-preview1 Oct 12, 2016
@HaoK HaoK removed this from the 1.1.0 milestone Oct 26, 2016
@HaoK
Copy link
Member

HaoK commented Oct 26, 2016

Clearing for triage

@HaoK
Copy link
Member

HaoK commented Jan 11, 2017

@blowdart we should clean this up and use this issue to track spliting Identity Core from SignInManager + Auth

@HaoK HaoK changed the title Decouple SignInManager from cookies Split Identity into Identity.Core (User/RoleManager) / Identity.Http (Cookies/Authentication) Jan 11, 2017
@HaoK HaoK added this to the 2.0.0 milestone Jan 11, 2017
@HaoK HaoK self-assigned this Jan 11, 2017
@HaoK HaoK changed the title Split Identity into Identity.Core (User/RoleManager) / Identity.Http (Cookies/Authentication) Split Identity into Identity.Core (User/RoleManager) / Identity.Authentication (Cookies) Jan 11, 2017
@HaoK
Copy link
Member

HaoK commented Jan 13, 2017

If we do this we should revisit whether we want to keep CancellationToken at all

@brockallen
Copy link

If you do this, then some of the APIs on SignInManager should be moved to UserManager (the ones that do lockout/brute-force prevention are the first ones that comes to mind).

@HaoK
Copy link
Member

HaoK commented Mar 7, 2017

Due to aspnet/Security#1113, we can remove the dependency on Http by depending directly on the new IAuthenticationService, and removing the default wireup to RequestAborted, we can either eliminate the CancellationToken on the stores entirely, or expose some kind of CancellationToken Source service or property on UserManager

@HaoK HaoK changed the title Split Identity into Identity.Core (User/RoleManager) / Identity.Authentication (Cookies) Consider removing dependency on Http for Identity Mar 7, 2017
@HaoK
Copy link
Member

HaoK commented Mar 7, 2017

Actually we can't since the caller needs to still pass in the HttpContext

@HaoK HaoK changed the title Consider removing dependency on Http for Identity Revisit identity factoring and react to Auth 2.0 Mar 7, 2017
@HaoK
Copy link
Member

HaoK commented Mar 7, 2017

But still switching this bug over to track revisiting identity factoring and react to the auth 2.0 changes

@ajcvickers ajcvickers modified the milestones: 2.0.0-preview1, 2.0.0 Apr 19, 2017
@HaoK
Copy link
Member

HaoK commented May 23, 2017

e6f3ebf

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants