-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Fix up how OIDC errors flow #4520
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add some basic tests, this already regressed once.
We don't even have the infrastructure set up yet... https://github.com/aspnet/Security/issues/772 I'd like to test it with the template test that caught the regression but I think we'd have to check in for that to run. |
Interesting case (that I had obviously not taken into account 😄) I guess what you have now is fine, but I'm tempted to think it would be a good idea to also fix the B2C code to use the new event (instead of determining whether the exception message of |
Yes B2C could use the new AccessDenied event, but it would still end up checking for a specific error code associated with password resets. |
I think this should drive adding the infrastructure to at least add a test for this regression |
e2eed3a
to
33df19c
Compare
@HaoK let's merge this to unblock preview2. |
Well constantly punting on test coverage in OIDC is what got us to this place, can't you just add something basic at least for the regression flow? |
How can we even be sure this fixes the issue for example with no tests? |
I did find some tests for this scenario here: https://github.com/aspnet/AspNetCore/blob/c7d63649005c4c2863b34794994eef57595e7bb7/src/AADIntegration/test/Microsoft.AspNetCore.Authentication.AzureADB2C.UI.Test/AzureAdB2COpenIDConnectEventHandlersTests.cs#L99-L113 They hadn't failed because they were mocking the RemoteFailureContext. Since B2C is relying on specific types and strings I would only expect a behavior change like this to be caught by a functional test in B2C. I'll try writing one there. |
Sounds good to me, yeah just one regression test in the b2c stuff as part of this PR to show that we fixed something and will catch at least this regression in the future works |
33df19c
to
647fd02
Compare
Updated |
#4384 @PinpointTownes
This tweaks the new AccessDenied feature (aspnet/Security#1887) to avoid changing the error and losing fidelity for the OIDC scenario.