Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: Unauthorized changed to Forbidden in v2.2 #25

Closed
hbiarge opened this issue Mar 14, 2019 · 1 comment
Closed

Regression: Unauthorized changed to Forbidden in v2.2 #25

hbiarge opened this issue Mar 14, 2019 · 1 comment
Assignees

Comments

@hbiarge
Copy link
Collaborator

hbiarge commented Mar 14, 2019

We need to double check a change in the behavior of the library related to this

@hbiarge
Copy link
Collaborator Author

hbiarge commented Mar 16, 2019

Well, I can confirm this is a breaking change after change the way the library is sending the user information.
Previous to this version the DefaultClaimsEncoder class serialized only the ClaimsType and Value of the Claims collection in a very manual way. In this version we changed that in order to include in the serialization all the information a Claim can include. To do this we create an AuthenticationTicket and use the TicketSerializer class to seralize the whole ticket.
As a consequence there is a breaking change when you send an empty collection of claims in the WithIdentity extension method. Before this change, this produced an Unauthorized result, because there is no ClaimsPrincipal created because the empty claims. After this version this produces a Forbidden response, because a ClaimsPrincpal without claims is created, so the request is authenticated but it fails in the authorization process.

@hbiarge hbiarge closed this as completed Mar 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant