Skip to content

Commit

Permalink
Fix issues with custom authenticators (#1016)
Browse files Browse the repository at this point in the history
* Use config authenticator

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Lint

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Turn off minify for debugging

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Handle type error

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Turn off trajectories

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Check for user data before setting, log in login page

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Require auth for appbar

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Return promise for axios request and response

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Catch async error

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* error log entire exception

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Remove return

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* log tokens

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* more logging with kc

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Check if kc init

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Reset window location when error on interceptor response

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Reset page interceptor request fails too

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Revert logging changes

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Catch in keycloak authenticator refreshToken

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Check userprofile for userprofileprovider only

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Check response error fields

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Test without userprofileprovider

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Revert all logs and changes for debugging

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Revert changes to rmf-dashboard

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Revert minification

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Add location.origin to redirect URI

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

---------

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
  • Loading branch information
aaronchongth authored Oct 10, 2024
1 parent f7f962d commit e1a91fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/dashboard/src/app-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const authenticator: Authenticator = (() => {
if (APP_CONFIG_AUTH_PROVIDER === 'keycloak') {
return new KeycloakAuthenticator(
APP_CONFIG.authConfig as KeycloakAuthConfig,
`${import.meta.env.BASE_URL}silent-check-sso.html`,
`${location.origin}${import.meta.env.BASE_URL}silent-check-sso.html`,
);
} else if (APP_CONFIG_AUTH_PROVIDER === 'stub') {
return new StubAuthenticator();
Expand Down
5 changes: 2 additions & 3 deletions packages/dashboard/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import '@fontsource/roboto/500.css';
import '@fontsource/roboto/700.css';
import './app.css';

import { appConfig } from './app-config';
import { appConfig, authenticator } from './app-config';
import { InitialWindow, LocallyPersistentWorkspace, RmfDashboard, Workspace } from './components';
import { MicroAppManifest } from './components/micro-app';
import doorsApp from './micro-apps/doors-app';
Expand All @@ -13,7 +13,6 @@ import createMapApp from './micro-apps/map-app';
import robotMutexGroupsApp from './micro-apps/robot-mutex-groups-app';
import robotsApp from './micro-apps/robots-app';
import tasksApp from './micro-apps/tasks-app';
import StubAuthenticator from './services/stub-authenticator';

const mapApp = createMapApp({
attributionPrefix: appConfig.attributionPrefix,
Expand Down Expand Up @@ -59,7 +58,7 @@ export default function App() {
<RmfDashboard
apiServerUrl={appConfig.rmfServerUrl}
trajectoryServerUrl={appConfig.trajectoryServerUrl}
authenticator={new StubAuthenticator()}
authenticator={authenticator}
helpLink={appConfig.helpLink}
reportIssueLink={appConfig.reportIssue}
resources={appConfig.resources.default}
Expand Down

0 comments on commit e1a91fa

Please sign in to comment.