-
Notifications
You must be signed in to change notification settings - Fork 288
fix(ui): package the OIDC silent-callback page so it actually works #2549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
thjaeckle
merged 4 commits into
eclipse-ditto:master
from
beyonnex-io:fix/ui-package-silent-callback
Oct 1, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9ded612
fix(ui): package the OIDC silent-callback page so it actually works
thjaeckle 4b97d55
build(ui): add a .dockerignore so the build context is not the whole …
thjaeckle 1a92693
fix(ui): type-check silent-callback.ts and address review notes
thjaeckle 58d1595
Merge remote-tracking branch 'origin/master' into fix/ui-package-sile…
thjaeckle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # The image serves static files only: the Dockerfile copies index.html, | ||
| # silent-callback.html and dist/, and nothing else is needed at build time. | ||
| # | ||
| # Without this file the whole ui/ tree is sent to the daemon as build context - | ||
| # node_modules alone dwarfs everything the image actually contains, which makes a | ||
| # three-COPY build take minutes. | ||
| # | ||
| # Allowlist rather than denylist: adding a COPY without extending this list fails | ||
| # the build instead of silently depending on whatever happens to be lying around. | ||
| * | ||
| !index.html | ||
| !silent-callback.html | ||
| !dist | ||
|
|
||
| # Source maps are only produced by `npm start` (esbuild serve); keep stale ones left in a | ||
| # local dist/ out of locally built images. | ||
| dist/**/*.map | ||
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| /* | ||
| * Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| * | ||
| * See the NOTICE file(s) distributed with this work for additional | ||
| * information regarding copyright ownership. | ||
| * | ||
| * This program and the accompanying materials are made available under the | ||
| * terms of the Eclipse Public License 2.0 which is available at | ||
| * http://www.eclipse.org/legal/epl-2.0 | ||
| * | ||
| * SPDX-License-Identifier: EPL-2.0 | ||
| */ | ||
| import { UserManager, UserManagerSettings } from 'oidc-client-ts'; | ||
|
|
||
| /* | ||
| * Entry point for silent-callback.html, the page oidc-client-ts loads in a hidden iframe as | ||
| * `silent_redirect_uri` when renewing an access token without a refresh token. | ||
| * | ||
| * The page's only job is to hand the response URL back to the parent frame; | ||
| * `signinSilentCallback()` delegates to IFrameNavigator.callback(), which reads nothing from | ||
| * the settings except the optional `iframeNotifyParentOrigin` (defaulting to this page's own | ||
| * origin). Hence the placeholder settings below: `authority`, `client_id` and `redirect_uri` are | ||
| * required by UserManagerSettings but are never touched on this path. | ||
| * | ||
| * Because the settings are hard-coded, a provider's configured `iframeNotifyParentOrigin` is not | ||
| * applied here, so this page only works when served from the same origin as the UI itself (as | ||
| * the Docker image does). A `silent_redirect_uri` on a different origin is not supported. | ||
| * | ||
| * Passing an object at all is what matters - `new UserManager()` throws, because | ||
| * UserManagerSettingsStore dereferences `args.redirect_uri` before any defaulting. | ||
| */ | ||
| const callbackOnlySettings: UserManagerSettings = { | ||
|
hu-ahmed marked this conversation as resolved.
|
||
| authority: '', | ||
| client_id: '', | ||
| redirect_uri: '', | ||
| }; | ||
|
hu-ahmed marked this conversation as resolved.
|
||
|
|
||
| new UserManager(callbackOnlySettings) | ||
| .signinSilentCallback() | ||
| .catch((error) => { | ||
| // Nothing is recoverable from inside the iframe: oidc-client-ts times the silent | ||
| // request out and raises a SilentRenewError on the UserManager that started it. | ||
| console.error('Silent refresh callback failed:', error); | ||
| }); | ||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.