-
Notifications
You must be signed in to change notification settings - Fork 95
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
redirect_uri should be URL Encoded when redirecting to Authorization server URL #257
Comments
Hi Jenkins team & OIDC team, I submitted a PR on Gitea side to "fix" the URL problem. Actually, according to the standard, the URL parameter should be encoded. Suppose there is But now Jenkins generates: |
Hello. This is actually a gray area of the standard and usual practice is to place it at the end to avoid issues. People that need a reditrect with parameter can encode it themselves in config. It is not ideal but better than yet another config parameter. That said, I wonder if this is still possible after #261. |
I disagree.
|
261 is not directly related. Actually, by using 261, end users must provide the real URL like |
I agree with you on the normative aspect, it should be url encoded but in practice, it isn't. Proof is that it works with current implementation on all major OIDC. I don't know all client library but I have encountered 2 providers where url encoding the redirect caused the redirect verification to fail. Regarding #261, I mean that the implementation verifies that the URL configured is well formed and if someone urlencodes the "https://" part in config, this will fail. I guess, I 'll just wait for defects to stream in |
@wxiaoguang looking into the matter more deeply, it may be a choice from google oauth library for security reason or it may be a bug (to avoid query parameter injection) or (as I assumed) a way to handle provider that do not interpret parameters in redirect. You can raise the issue with them. |
What feature do you want to see added?
I've noticed that the redirect_uri parameter in the plugin is not URL encoded when redirecting to the Authorization server URL. While I couldn't find a hard rule explicitly stating that the redirect_uri must be URL encoded, I have observed that all the examples and best practices include the redirect_uri as URL encoded.
Suggestion:
I propose that the "oic-auth-plugin" should encode the redirect_uri parameter before appending and redirecting to the Authorization server URL. This adjustment would align the plugin with common best practices and increase compatibility with a wider range of clients.
Additional Information:
We are facing issues with Gitea on login, and we suspect that this is because Gitea expects the redirect_uri to be URL encoded. This issue is reflected in the following Gitea GitHub issues:
go-gitea/gitea#26097
go-gitea/gitea#26945
I'd appreciate your thoughts on this matter and any feedback you might have regarding the suggested change. Thank you for your attention to this issue.
Upstream changes
No response
The text was updated successfully, but these errors were encountered: