mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-01 19:18:05 +00:00
GEN-1578: SAML redirect leads to 404 page on UI (#17978)
* move routes to callback router * move callback routes to global router * added comments * make saml and confidential callback route public (cherry picked from commit c709ec6c29ada205cd1764f844ea45ee9c71316e)
This commit is contained in:
parent
d83e3a6de8
commit
4f4cf29678
@ -25,6 +25,8 @@ import AppContainer from '../AppContainer/AppContainer';
|
||||
import Loader from '../common/Loader/Loader';
|
||||
import { UnAuthenticatedAppRouter } from './UnAuthenticatedAppRouter';
|
||||
|
||||
import SamlCallback from '../../pages/SamlCallback';
|
||||
|
||||
const AppRouter = () => {
|
||||
const location = useLocation();
|
||||
|
||||
@ -91,6 +93,14 @@ const AppRouter = () => {
|
||||
<Route exact component={SignUpPage} path={ROUTES.SIGNUP}>
|
||||
{!isEmpty(currentUser) && <Redirect to={ROUTES.HOME} />}
|
||||
</Route>
|
||||
|
||||
{/* When authenticating from an SSO provider page (e.g., SAML Apps), if the user is already logged in,
|
||||
the callbacks should be available. This ensures consistent behavior across different authentication scenarios. */}
|
||||
<Route
|
||||
component={SamlCallback}
|
||||
path={[ROUTES.SAML_CALLBACK, ROUTES.AUTH_CALLBACK]}
|
||||
/>
|
||||
|
||||
{isAuthenticated ? <AppContainer /> : <UnAuthenticatedAppRouter />}
|
||||
</Switch>
|
||||
);
|
||||
|
||||
@ -17,7 +17,6 @@ import { ROUTES } from '../../constants/constants';
|
||||
import { AuthProvider } from '../../generated/configuration/authenticationConfiguration';
|
||||
import { useApplicationStore } from '../../hooks/useApplicationStore';
|
||||
import PageNotFound from '../../pages/PageNotFound/PageNotFound';
|
||||
import SamlCallback from '../../pages/SamlCallback';
|
||||
import AccountActivationConfirmation from '../../pages/SignUp/account-activation-confirmation.component';
|
||||
import { isProtectedRoute } from '../../utils/AuthProvider.util';
|
||||
import Auth0Callback from '../Auth/AppCallbacks/Auth0Callback/Auth0Callback';
|
||||
@ -74,10 +73,7 @@ export const UnAuthenticatedAppRouter = () => {
|
||||
{callbackComponent && (
|
||||
<Route component={callbackComponent} path={ROUTES.CALLBACK} />
|
||||
)}
|
||||
<Route
|
||||
component={SamlCallback}
|
||||
path={[ROUTES.SAML_CALLBACK, ROUTES.AUTH_CALLBACK]}
|
||||
/>
|
||||
|
||||
{!isSigningUp && (
|
||||
<Route exact path={ROUTES.HOME}>
|
||||
<Redirect to={ROUTES.SIGNIN} />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user