-
Notifications
You must be signed in to change notification settings - Fork 0
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
Missing required parameter client_id returning invalid_client #44
Comments
We'll have a look, thanks. |
@brockallen if you agree to this issue we can create a PR. |
@leastprivilege to review. the issue here is that our abstraction over validating client credentials doesn't indicate this specific missing param as a special case. |
@StefRoo, i understand the desire to be as spec compliant as possible, but is there a real/practical reason that the error code being invalid_request vs. invalid_client really matters? I'm thinking that in either case, a client would know there's an error and need to consult the logs to determine the real issue. I can't see how the distinction matters in a real runtime environment (but that's why I'm asking). |
@brockallen @StefRoo , It might be very semantic but the client could interpret invalid_request as that they should probably alter a parameter in the request. On the other hand they could interpret invalid_client as authentication fails so that they will investigate the authentication process. The reason why we insist for this change is that the third party audits our product for compliancy to the OAuth specification and at this point we have a non-conformity. To mitigate this non-conformity we had to override the whole Token endpoint, so extensibility was quite unpractical. Even if we don't want to make a change to the validation of the client credentials perhaps we could provide for better extensibility. |
Ok, I looked again and there is a fairly small change to accommodate that specific error condition. PR is submitted. |
@brockallen Amazing, looks good! Thanks |
Which version of Duende IdentityServer are you using?
v4.
Which version of .NET are you using?
.NET 6
Describe the bug
A third party pointed out to us that upon sending us a request on our token endpoint in the flow described in the OAuth2.0 specifications in chapter 4.1, the Authorization Code Grant, without a client_id configured, we return an error-response with the error-code set to 'invalid_client'. We have seen in the codebase of IdentityServer that this is default behaviour, as can be seen in the ClientSecretValidator:
And in the TokenEndpoint:
To Reproduce
Send a request to the TokenEndpoint with no client_id configured.
Expected behavior
In our use case, section 4.1 of the OAuth2.0 specification, the client_id is a required parameter. As RFC 6749 section 5.2 states, if a required parameter is missing in a request, an error-response with the error-code set to 'invalid_request' should be returned. We would therefore expect the default TokenEndpoint implementation to return an 'invalid_request' instead of an 'invalid_client' when the entire parameter is missing, and an 'invalid_client' when the content of the parameter is missing or empty.
We would like to hear your thoughts on this issue.
The text was updated successfully, but these errors were encountered: