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

After authentication fails,the state code of response is still 401 but not 302,it happens when the version of Microsoft.AspNetCore.Authentication.Cookies is above 1.0.0 #1059

Closed
HongyanShen opened this issue Dec 4, 2016 · 1 comment

Comments

@HongyanShen
Copy link

I compared Microsoft.AspNetCore.Authentication.Cookies 1.0.0 and Microsoft.AspNetCore.Authentication.Cookies 1.1.0.I found the ChallengeAsync of AuthenticationHandler,cs makes this difference.
The end of ChallengeAsync 1.0.0 is:
if (!handled && PriorHandler != null) { await PriorHandler.ChallengeAsync(context); }
however the end of ChallengeAsync 1.1.0 is
if (PriorHandler != null) { await PriorHandler.ChallengeAsync(context); }
and in the ChallengeAsync 1.1.0, the await PriorHandler.ChallengeAsync(context); will change the state code of response from 302 to 401.
Is this a bug or I use Microsoft.AspNetCore.Authentication.Cookies 1.1.0 in a wrong way?

@kevinchalet
Copy link
Contributor

FYI, this design change was discussed here: #1044.

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

3 participants