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 <[email protected]>

* Lint

Signed-off-by: Aaron Chong <[email protected]>

* Turn off minify for debugging

Signed-off-by: Aaron Chong <[email protected]>

* Handle type error

Signed-off-by: Aaron Chong <[email protected]>

* Turn off trajectories

Signed-off-by: Aaron Chong <[email protected]>

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

Signed-off-by: Aaron Chong <[email protected]>

* Require auth for appbar

Signed-off-by: Aaron Chong <[email protected]>

* Return promise for axios request and response

Signed-off-by: Aaron Chong <[email protected]>

* Catch async error

Signed-off-by: Aaron Chong <[email protected]>

* error log entire exception

Signed-off-by: Aaron Chong <[email protected]>

* Remove return

Signed-off-by: Aaron Chong <[email protected]>

* log tokens

Signed-off-by: Aaron Chong <[email protected]>

* more logging with kc

Signed-off-by: Aaron Chong <[email protected]>

* Check if kc init

Signed-off-by: Aaron Chong <[email protected]>

* Reset window location when error on interceptor response

Signed-off-by: Aaron Chong <[email protected]>

* Reset page interceptor request fails too

Signed-off-by: Aaron Chong <[email protected]>

* Revert logging changes

Signed-off-by: Aaron Chong <[email protected]>

* Catch in keycloak authenticator refreshToken

Signed-off-by: Aaron Chong <[email protected]>

* Check userprofile for userprofileprovider only

Signed-off-by: Aaron Chong <[email protected]>

* Check response error fields

Signed-off-by: Aaron Chong <[email protected]>

* Test without userprofileprovider

Signed-off-by: Aaron Chong <[email protected]>

* Revert all logs and changes for debugging

Signed-off-by: Aaron Chong <[email protected]>

* Revert changes to rmf-dashboard

Signed-off-by: Aaron Chong <[email protected]>

* Revert minification

Signed-off-by: Aaron Chong <[email protected]>

* Add location.origin to redirect URI

Signed-off-by: Aaron Chong <[email protected]>

---------

Signed-off-by: Aaron Chong <[email protected]>
  • 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.