mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-19 12:50:20 +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
This commit is contained in:
parent
bc6f4824ea
commit
c709ec6c29
@ -26,6 +26,8 @@ import AppContainer from '../AppContainer/AppContainer';
|
|||||||
import Loader from '../common/Loader/Loader';
|
import Loader from '../common/Loader/Loader';
|
||||||
import { UnAuthenticatedAppRouter } from './UnAuthenticatedAppRouter';
|
import { UnAuthenticatedAppRouter } from './UnAuthenticatedAppRouter';
|
||||||
|
|
||||||
|
import SamlCallback from '../../pages/SamlCallback';
|
||||||
|
|
||||||
const AppRouter = () => {
|
const AppRouter = () => {
|
||||||
const location = useCustomLocation();
|
const location = useCustomLocation();
|
||||||
|
|
||||||
@ -92,6 +94,14 @@ const AppRouter = () => {
|
|||||||
<Route exact component={SignUpPage} path={ROUTES.SIGNUP}>
|
<Route exact component={SignUpPage} path={ROUTES.SIGNUP}>
|
||||||
{!isEmpty(currentUser) && <Redirect to={ROUTES.HOME} />}
|
{!isEmpty(currentUser) && <Redirect to={ROUTES.HOME} />}
|
||||||
</Route>
|
</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 />}
|
{isAuthenticated ? <AppContainer /> : <UnAuthenticatedAppRouter />}
|
||||||
</Switch>
|
</Switch>
|
||||||
);
|
);
|
||||||
|
@ -18,7 +18,6 @@ import { AuthProvider } from '../../generated/configuration/authenticationConfig
|
|||||||
import { useApplicationStore } from '../../hooks/useApplicationStore';
|
import { useApplicationStore } from '../../hooks/useApplicationStore';
|
||||||
import useCustomLocation from '../../hooks/useCustomLocation/useCustomLocation';
|
import useCustomLocation from '../../hooks/useCustomLocation/useCustomLocation';
|
||||||
import PageNotFound from '../../pages/PageNotFound/PageNotFound';
|
import PageNotFound from '../../pages/PageNotFound/PageNotFound';
|
||||||
import SamlCallback from '../../pages/SamlCallback';
|
|
||||||
import AccountActivationConfirmation from '../../pages/SignUp/account-activation-confirmation.component';
|
import AccountActivationConfirmation from '../../pages/SignUp/account-activation-confirmation.component';
|
||||||
import { isProtectedRoute } from '../../utils/AuthProvider.util';
|
import { isProtectedRoute } from '../../utils/AuthProvider.util';
|
||||||
import Auth0Callback from '../Auth/AppCallbacks/Auth0Callback/Auth0Callback';
|
import Auth0Callback from '../Auth/AppCallbacks/Auth0Callback/Auth0Callback';
|
||||||
@ -76,10 +75,7 @@ export const UnAuthenticatedAppRouter = () => {
|
|||||||
{callbackComponent && (
|
{callbackComponent && (
|
||||||
<Route component={callbackComponent} path={ROUTES.CALLBACK} />
|
<Route component={callbackComponent} path={ROUTES.CALLBACK} />
|
||||||
)}
|
)}
|
||||||
<Route
|
|
||||||
component={SamlCallback}
|
|
||||||
path={[ROUTES.SAML_CALLBACK, ROUTES.AUTH_CALLBACK]}
|
|
||||||
/>
|
|
||||||
{!isSigningUp && (
|
{!isSigningUp && (
|
||||||
<Route exact path={ROUTES.HOME}>
|
<Route exact path={ROUTES.HOME}>
|
||||||
<Redirect to={ROUTES.SIGNIN} />
|
<Redirect to={ROUTES.SIGNIN} />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user