Skip to content

Ask Gemini to fix missing URL-decoding of basic auth credentials. #50

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kentonv
Copy link
Member

@kentonv kentonv commented Jun 12, 2025

Fixes #41

Prompt: We received a bug report: "As per https://www.rfc-editor.org/rfc/rfc6749.html#section-2.3.1 and https://www.rfc-editor.org/rfc/rfc6749.html#appendix-B, OAuth uses a modified form of Basic auth in which the client id and secret are url-encoded first before being combined and then base64-encoded." Apparently, we aren't performing this URL encoding. Can you fix it?

Gemini actually fixed the second part of the issue, too: that the secret can technically contain colons. I didn't actually prompt it to fix that, it just did it. Neat.

(Note that valid client IDs and secrets are always generated by this library itself, and it does not include colons nor characters needing URL encoding, so this issue is never a problem in practice, but we should be implementing what the spec says.)

This was a test using Gemini 2.5-Pro under Windsurf. (I am trying out various models and environments...)

Fixes #41

Prompt: We received a bug report: "As per https://www.rfc-editor.org/rfc/rfc6749.html#section-2.3.1 and https://www.rfc-editor.org/rfc/rfc6749.html#appendix-B, OAuth uses a modified form of Basic auth in which the client id and secret are url-encoded first before being combined and then base64-encoded." Apparently, we aren't performing this URL encoding. Can you fix it?

Gemini actually fixed the second part of the issue, too: that the secret can technically contain colons. I didn't actually prompt it to fix that, it just did it. Neat.

(Note that valid client IDs and secrets are always generated by this library itself, and it does not include colons nor characters needing URL encoding, so this issue is never a problem in practice, but we should be implementing what the spec says.)

This was a test using Gemini 2.5-Pro under Windsurf. (I am trying out various models and environments...)
@kentonv kentonv requested a review from cmsparks June 12, 2025 02:06
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

Successfully merging this pull request may close these issues.

Incorrect Basic auth implementation
2 participants