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

OpenIdConnectProtocolValidator cannot validate state #516

Open
DevJasperNL opened this issue Nov 28, 2023 · 4 comments
Open

OpenIdConnectProtocolValidator cannot validate state #516

DevJasperNL opened this issue Nov 28, 2023 · 4 comments

Comments

@DevJasperNL
Copy link

We are currently in the process of hardening our OIDC implementation. As part of this, we want state to be validated.

However, after enabling RequireState and RequireStateValidation, we get an exception:
Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolInvalidStateException: 'IDX21329: RequireState is 'True' but the OpenIdConnectProtocolValidationContext.State is null. State cannot be validated.'

After further investiation, I see that inside the OpenIdConnectProtocolValidator, OpenIdConnectProtocolValidationContext.State remains null.

When looking into where this is created, it seems that State is never set on this context:

Options.ProtocolValidator.ValidateAuthenticationResponse(new OpenIdConnectProtocolValidationContext()

@DevJasperNL
Copy link
Author

Related ASPNETCORE issue: dotnet/aspnetcore#52400

@Rora
Copy link

Rora commented Dec 11, 2023

I also need to know how to leverage the state, is there any update or expected timeline on this?

@RickvF
Copy link

RickvF commented Jan 17, 2024

I am facing the same issue. Can anyone please give an update on this?

@Tratcher
Copy link
Member

This product is in maintenance mode, feature updates aren't expected. If someone would like to submit a PR then we can at least get this into the nightly builds.

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

No branches or pull requests

4 participants