-
Notifications
You must be signed in to change notification settings - Fork 193
Update AuthenticationManager.AuthenticateAsync to return an AuthenticationTicket #572
Comments
+1 |
I'm not opposed to bringing back AuthenticateResult I guess, perhaps as an AuthenticateUser overload instead of a Get...
|
Is it too late for RC2? I think it would be worth fixing that before RTM. |
And @blowdart for that matter. |
I'm fine with it |
@HaoK can you take this? And give us an estimate on churn? I'm concerned that this will be too much churn for RC2. |
I can take it, its not too bad if we do something like: Today's Authenticate => AuthenticateUser Its a breaking change but not that widespread outside of identity and maybe Authorize filter in MVC |
Or if we want to minimize churn we can flip the names... Authenticate stays the same returning Principal. |
As mentioned by @HaoK the impact should be limited (https://github.com/search?q=user%3Aaspnet+AuthenticateAsync&ref=reposearch&type=Code&utf8=%E2%9C%93), but I can help with the task 👏 I also think we should remove the |
We'll bring back the old |
Thoughts on |
I dig it. |
|
I think @HaoK's initial proposition was a good compromise, and was clear enough, but as long as the overload taking an |
I'm ambivalent between AuthenticateDetails/Info. Maybe |
So here's what I'm thinking for the new shape: // On the abstract base AuthenticationManager:
public abstract Task<AuthenticateResult> GetAuthenticateResultAsync(string authenticationScheme);
public abstract Task<ClaimsPrincipal> AuthenticateAsync(string authenticationScheme);
// Remove: public abstract void AuthenticateAsync(string authenticationScheme);
public class AuthenticateResult {
public ClaimsPrincipal Principal { get; set; }
public AuthenticationProperties Properties { get; set; }
} |
Doesn't aspnet/Security already have an |
Ugh that's right, name was too good to still be available :) That's the problem with having the same method I guess... Whelp back to AuthenticateInfo/Details then... |
In June, the
AuthenticateAsync
method was updated to return aClaimsPrincipal
instead of anAuthenticationResult
(a type similar toAuthenticationTicket
). As a consequence, retrieving the authentication properties is much harder, and can only be done using the rather unusual overload taking anAuthenticateContext
parameter:#323 (comment)
@HaoK's main argument was that retrieving authentication properties was not really frequent. Sadly, I don't think it's true, as retrieving the expiration date from the ticket is quite popular: http://stackoverflow.com/a/34535003/542757
If you really think having a method returning a
ClaimsPrincipal
is important, why not adding an extension method?The text was updated successfully, but these errors were encountered: