-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
OIDC CodeAuthenticationMechanism
should not fail silently
#21500
Comments
/cc @pedroigor, @sberyozkin |
Hi @rgmz Thanks for opening this issue, but IMHO it won't need to be addressed. Let me also comment further
We don't do it for the security errors
Yes, that would be giving the attacker too much information and helping with trying more variations.
It is a good idea but only if we could know it was necessary to always have a client_secret - besides there could be other reasons why the code flow can fail to complete.
This is similar to the earlier comment - the flow may fail to complete for many other reasons, or the secret may be set but the secret value mistyped. IMHO checking the logs at the debug level is a reasonable but also secure approach. However, you've reminded me about the problem with the https://quarkus.io/version/main/guides/security-openid-connect-web-authentication guide: it should really not use a Thanks |
Marking it as a OIDC web-app guide bug |
@sberyozkin: Thanks for the quick reply; I'll provide a thoughtful response later. I also noticed that the UserInfo section of that guide refers to If I noticed any other issues with the OIDC docs, would you prefer that I open separate issues for each, or note them in the existing meta-issue (#20036)? |
Hi @rgmz Oh, thanks for spotting it :-). It would be fine to open dedicated issues, the epic issue is a high level one to improve the security docs. If you'd like, please create the one for the userinfo typo, a PR will be welcome too |
Description
When users are redirected back to Quarkus after authentication, it's possible for their request to 'fail silently' (return a 401 with no body) if there's an issue calling the token endpoint. Because no body is returned, and errors are logged at
debug
level, it can be difficult to troubleshoot the 401.One could argue that this doesn't need to be logged, but in my experience it's confusing to see a "401" and not be able to tell if it's coming from the application or the IdP. I encountered this issue after following the "Using OpenID Connect (OIDC) to Protect Web Applications..." and accidentally setting
quarkus.oidc.secret
instead ofquarkus.oidc.credentials.secret
; it wasn't obvious that "401" mean "error trying to authenticate because of invalid credentials".Implementation ideas
Two potential ways to make this more obvious:
WARN
level instead ofDEBUG
quarkus/extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/CodeAuthenticationMechanism.java
Line 300 in 2e8c6a8
5xx
error if there's an unexpected authentication error. For example, Quarkus throws an error if you provide an invalidauth-server-url
:The text was updated successfully, but these errors were encountered: