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

Update the ASP.NET Core/OWIN integrations to allow returning authentication tickets with a null or empty principal #1912

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

kevinchalet
Copy link
Member

Currently, a null authentication ticket (or an AuthenticateResult.NoResult() result for ASP.NET Core) is returned by the ASP.NET Core and OWIN hosts when no "main principal" can be found based on the request type and grant type.

Sadly, this logic makes advanced scenarios like custom grant types that need to validate incoming tokens (e.g a grant type that accepts an access token parameter) harder to implement, as AuthenticateAsync(...) doesn't return anything useful in 5.0 (in 4.0, calling AuthenticateAsync() for custom grant types wasn't supported).

This PR changes that by returning an authentication ticket with an empty/null principal and a non-empty AuthenticationProperties that can be used to access the other types of validated tokens.

…cation tickets with a null or empty principal
@kevinchalet kevinchalet added this to the 5.0.0-preview2 milestone Nov 7, 2023
@kevinchalet kevinchalet self-assigned this Nov 7, 2023
@kevinchalet kevinchalet merged commit 7391a3e into openiddict:dev Nov 7, 2023
6 checks passed
@kevinchalet kevinchalet deleted the host_integrations branch November 7, 2023 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant