Skip to content

Conversation

@sfc-gh-mkeller
Copy link
Collaborator

@sfc-gh-mkeller sfc-gh-mkeller commented Jan 30, 2025

Please answer these questions before submitting your pull requests. Thanks!

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

    Fixes SNOW-1825621

  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.

    The last piece of the new OAuth code flow implementation.
    The PR builds on top of SNOW-1825621 OAuth code flow PKCE support #2137 and SNOW-1825495 OAuth flows implementation #2135, so those should be merged before this one is reviewed.
    I've added support for refresh token consumption and tested it. Unfortunately this is kind of useless until we introduce a OAUTH token cache, so that needs adding still.

  4. (Optional) PR for stored-proc connector:

@sfc-gh-mkeller sfc-gh-mkeller force-pushed the mkeller/SNOW-1825621/refresh-token-token-cache branch from 7f15277 to 7a861c1 Compare January 30, 2025 18:43
@sfc-gh-mkeller sfc-gh-mkeller changed the base branch from main to mkeller/SNOW-1825621/pkce-support January 31, 2025 17:40
Copy link
Contributor

@sfc-gh-eworoshow sfc-gh-eworoshow left a comment

Choose a reason for hiding this comment

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

Nice!

),
"oauth_security_features": (
("pkce",),
("pkce", "refresh_token"),
Copy link
Contributor

Choose a reason for hiding this comment

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

we should omit refresh_token from the default, since the default oauth integration will not have refresh tokens enabled unless the admin turns them on explicitly

logger.info(
"oauth refresh token is available, going to try consuming it to recover"
)
self._consume_refresh_token(conn=conn)
Copy link
Contributor

Choose a reason for hiding this comment

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

we only need to use the refresh token after the access token has expired, in order to create a new session without reprompting for credentials

@sfc-gh-mmishchenko sfc-gh-mmishchenko self-assigned this Feb 12, 2025
Base automatically changed from mkeller/SNOW-1825621/pkce-support to mkeller/SNOW-1825621/oauth-code-flow-support March 4, 2025 15:04
@sfc-gh-mmishchenko sfc-gh-mmishchenko force-pushed the mkeller/SNOW-1825621/oauth-code-flow-support branch 2 times, most recently from f4d206c to dafeb5b Compare March 10, 2025 00:17
@sfc-gh-mmishchenko sfc-gh-mmishchenko force-pushed the mkeller/SNOW-1825621/oauth-code-flow-support branch from e920d82 to 984246e Compare March 13, 2025 10:33
@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants