Add external OAuth callback support for V2#367
Open
thiva-k wants to merge 3 commits intoasgardeo:mainfrom
Open
Add external OAuth callback support for V2#367thiva-k wants to merge 3 commits intoasgardeo:mainfrom
thiva-k wants to merge 3 commits intoasgardeo:mainfrom
Conversation
78626c7 to
8207013
Compare
5cebeed to
19bb98c
Compare
brionmario
reviewed
Feb 17, 2026
brionmario
reviewed
Feb 17, 2026
35dc06a to
9e5a298
Compare
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. |
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 introduces a new, robust OAuth callback handling flow for both the React and React Router packages, improving reliability and maintainability of authentication flows. The main changes include the addition of a headless
BaseCallbackcomponent for OAuth parameter processing, a newCallbackcomponent for React Router, and the refactoring of OAuth code handling in theSignInandAcceptInviteflows to use a shareduseOAuthCallbackhook. This results in more secure state management, better error handling, and a cleaner separation of concerns between framework-agnostic logic and framework-specific navigation.Admin initiated user invite flow using the new Callback Component:
Screen.Recording.2026-02-17.at.15.07.41.mov
OAuth Callback Handling Infrastructure:
BaseCallbackcomponent inreactthat extracts and validates OAuth parameters from the URL, handles state management and errors, and redirects to the original path. This component is framework-agnostic and intended to be wrapped by framework-specific components.Callbackcomponent inreact-routerthat wrapsBaseCallbackand integrates with React Router's navigation, providing a drop-in solution for OAuth callback routes.Callbackcomponent from thereact-routerpackage for use in applications.Refactoring and Integration in Authentication Flows:
SignInandAcceptInviteflows to use the shareduseOAuthCallbackhook for processing OAuth callback parameters, replacing previous inline and duplicated logic. This improves consistency and reliability of OAuth code handling. [1] [2] [3] [4]SignInandAcceptInviteflows to use the newinitiateOAuthRedirectutility, ensuring secure state management and consistent redirect behavior. [1] [2]Security and Robustness Improvements:
flowIdis stored in sessionStorage when initiating OAuth flows, so it can be reliably retrieved during the callback phase.Minor Improvements and Cleanups:
SignInflow, such as theresolveFlowIdfunction and previous OAuth code handling effect. [1] [2]redirectURLin the normalized flow response for more flexible redirection handling.AcceptInviteflow.These changes collectively modernize and harden the OAuth authentication flow across the codebase, making it easier to maintain and extend in the future.