fix: add return url and connection id to oauth url state#1160
Open
lucaseduoli wants to merge 3 commits intomainfrom
Open
fix: add return url and connection id to oauth url state#1160lucaseduoli wants to merge 3 commits intomainfrom
lucaseduoli wants to merge 3 commits intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request enhances the OAuth authentication flow by supporting a configurable public return URL and improving how state is handled and parsed during the OAuth process. These changes ensure that after authentication, users are redirected to the appropriate location, and the connection ID is consistently tracked through the flow.
OAuth Flow Improvements:
public_return_urlto the OAuth response and included it in the state parameter during the OAuth handshake, allowing dynamic redirect destinations after authentication. (frontend/app/api/mutations/useConnectConnectorMutation.ts[1] [2] [3];frontend/contexts/auth-context.tsx[4] [5];src/config/settings.py[6];src/services/auth_service.py[7]public_return_urlin the OAuth config response, sourcing it from the newPUBLIC_RETURN_URLenvironment variable. (src/services/auth_service.py[1] [2]State Parameter Handling:
connection_idand the encoded return URL, and ensured it is properly encoded and decoded throughout the flow. (frontend/app/api/mutations/useConnectConnectorMutation.ts[1] [2];frontend/contexts/auth-context.tsx[3] [4];frontend/app/auth/callback/page.tsx[5]connection_idand the return URL, using these values to finalize authentication and redirect appropriately. (frontend/app/auth/callback/page.tsx[1] [2]Backend OAuth Connector Updates:
stateparameter and include it in the authorization URL if provided. (src/connectors/google_drive/oauth.py[1] [2]Code Cleanup:
src/services/auth_service.py[1] [2] [3]