Repository navigation
CAUSEWAY-4078: continues to original destination after transparent sign-in - #3878
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…gn-in Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
When the Wicket viewer is behind external authentication (Spring Security OAuth2/OIDC, a pre-authenticating proxy, or Keycloak), a user who follows a deep link such as
/wicket/entity/<logicalType>:<id>from an email always lands on the home page. The same happens when the session has expired and the next request re-authenticates without the user noticing.The requested URL makes it through external authentication; the Wicket viewer then drops it:
WebRequestCycleForCauseway.onBeginRequestonly signs in the Wicket session from the externalInteractionContextif a WicketSessionalready exists. On the first request of a new session, the@AuthorizeInstantiationcheck therefore fails, and Wicket redirects to the sign-in page, saving the requested URL as the original destination.WicketSignInPageconstructor always callsrestartAt(HOME), ignoring that saved destination.Fix
In
WicketSignInPage, when the session is already signed in, callcontinueToOriginalDestination()before falling back torestartAt(HOME). The fallback to the home page still applies when:causeway.viewer.wicket.clear-original-destinationis set.Interactive (username/password) sign-in is unchanged.
Tests
WicketSignInPageOriginalDestinationTest(inviewers/wicket/ui-test) uses WicketTester with stub pages to replay the intercept-then-signed-in request sequence. The deep-link test failed before the fix and passes after it. The other three tests check that the home page is still used when there is no saved destination, when the clear setting is on, and when an exception is being reported.The
viewers/wicketui-test (117 tests) and viewer (17 tests) suites pass.Not yet done
Checking this by hand in a consuming app (Estatio) for both the deep-link and the session-expiry cases. These are tasks 4.1 and 4.2 in the OpenSpec change
openspec/changes/wicket-deep-link-after-sso/, which also holds the proposal, design and spec.🤖 Generated with Claude Code