Skip to content

Separate server and redirect URIs in AuthHttpServer #2400

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 3 commits into
base: main
Choose a base branch
from

Conversation

npeshkov
Copy link

@npeshkov npeshkov commented Jul 11, 2025

  1. What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-2194055: AuthServer listens on redirect URI instead of localhost during OAuth Code flow #2396

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am modifying authorization mechanisms
    • I am adding new credentials
    • I am modifying OCSP code
    • I am adding a new dependency
  3. Please describe how your code solves the related issue.

    Allowing redirect URI to be different from server URI allows users to provide non-localhost redirect URIs (common in cloud IDEs) without preventing the server to start up on localhost.

    • Backwards compatible.
      • Default server URI host is localhost, which is the same as what users used to provide (non-localhost does not work).
      • Server's port is the port in the redirect URI (or random), which is the same as before.

Note: I couldn't run integration and auth tests locally, would need you help with that.

@npeshkov npeshkov marked this pull request as draft July 11, 2025 15:46
Copy link

github-actions bot commented Jul 11, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@npeshkov
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@npeshkov npeshkov marked this pull request as ready for review July 11, 2025 15:47
Comment on lines +122 to +124
uri=os.environ.get("SNOWFLAKE_OAUTH_SOCKET_ADDRESS", "http://localhost")
+ ":"
+ os.environ.get("SNOWFLAKE_OAUTH_SOCKET_PORT", "0"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't we use an f string here?

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.

SNOW-2194055: AuthServer listens on redirect URI instead of localhost during OAuth Code flow
2 participants