Repository navigation
Conversation
maximthomas
left a comment
There was a problem hiding this comment.
praise: The implied- and explicit-consent browser scenarios check that login alone leaves the device pending and that one code submission leads to token issuance.
issue (blocking): The default verification URI no longer works with a valid child-realm session on a shared hostname.
DeviceCodeVerificationResource.java:421–425
When a child provider leaves its verification URL blank, the issued URI is the deployment's realm-less /oauth2/device/user. On the base, GET displays the form and POST loads the code and applies its stored realm before client lookup and session validation, so a user signed into the child realm can complete verification on that URI. HEAD checks the realm inferred from the shared hostname on GET and sends that user to root login. If the subsequent POST directs the browser to child login, its return URL is still the realm-less URI, where the GET rejects the child session again. Default URI construction, base GET, POST code lookup and realm attributes, login return URL
Generate a realm-qualified verification URI by default and preserve compatibility for already-issued realm-less URLs by deferring the realm check on those URLs until the code identifies the provider.
Closure criterion On a shared hostname, a signed-out visitor can verify a child-realm device via its newly issued URI with one code entry. A visitor with a valid child session can still verify through an existing realm-less URI.
issue (blocking): Pre-login skips the mapped authentication chain for a signed-out device user.
ResourceOwnerSessionValidator.java:223–228
For a code issued with acr_values mapped to a non-default chain, the base learned that value on the first POST and selected the mapped chain in the login redirect. HEAD's GET authenticates against the realm default before the code is known. On the implied-consent POST, a valid same-realm session from the default chain can be accepted with ACR 0 because setCurrentAcr records the mismatch and validation proceeds. Stored ACR, base login chain selection, HEAD ACR matching, device approval
Keep the device verification pending while the browser completes the mapped chain when the initial login does not match. Preserve the verification continuation across that login.
Closure criterion A signed-out user with a code that requests a configured non-default chain completes that chain, the approved code records the matching ACR, and the user enters the code once.
suggestion (non-blocking): Check the consent setting before reusing a device client fixture.
device-flow-test.spec.mjs:125–129
The setup reuses an existing client based on its response type. On a reused instance where the explicit-consent client's persisted isConsentImplied is true, setup succeeds and the browser waits for an Allow button that never appears. Compare the stored flag with the requested value before returning and use the existing PUT for a mismatch. Fixture setup, browser assertion
…th2 device user code
… during device verification
2ef2757 to
c772792
Compare
|
@maximthomas, I addressed all three findings in c772792.
All 1,012 OAuth2 module tests and all 30 device verification and PKCE Playwright scenarios passed. |
maximthomas
left a comment
There was a problem hiding this comment.
praise: The bookmark scenario checks that the mapped login keeps the device pending, restores the submitted code, and records the matching ACR in the redeemed ID token.
issue (blocking): Stop repeating the mapped login when a custom login template keeps returning the default chain.
ResourceOwnerSessionValidator.java:229–238
With implied consent and a custom login template that forwards only goto, a signed-out user can get a valid session from the default chain and submit a code requesting a different mapped chain. Each POST now requires that chain, but the custom login builder renders the same login target without selecting it. The return GET accepts the same-realm session and shows the confirmation again. The previous revision approved the device with an unmatched ACR of 0. On HEAD the device remains pending until expiry. Custom-template test · POST guard · Login URL builders · Return GET · Previous approval path
Preserve the mapped-ACR requirement and track whether the server-side continuation already requested the mapped login. If the returned session still lacks the chain, show an actionable error. Custom login integrations that can satisfy the mapped ACR should complete the existing confirmation flow.
Closure criterion A custom login that returns the default chain never sends the user through repeated login and confirmation. When it returns the mapped chain, the browser completes authorization with one code entry, the same CSRF-protected confirmation, and the matching ACR.
…sted ACR is unmet
|
@maximthomas, I fixed the custom login loop in 9d17593. OpenAM remembers which ACR it requested for the submitted device code and checks the session as soon as the browser returns. If the custom login page returns the default chain again, the browser shows the required authentication method and the device stays pending. I reproduced the repeated confirmation on the previous revision with a template that forwards only All 1,012 OAuth2 module tests and all 32 device verification and PKCE browser scenarios passed. |
maximthomas
left a comment
There was a problem hiding this comment.
praise: The custom-login browser tests check pending state on both return paths and verify the ID token ACR after successful confirmation.
suggestion (non-blocking): Preserve a pending confirmation when the user signs in again through the default chain.
DeviceCodeVerificationResource.java:189–191
After mapped login has displayed the confirmation, a sign-out and default-chain sign-in in another tab can replace the SSO session while the servlet continuation and form CSRF token remain valid. On the previous revision, submitting the open form offered mapped login again. The current POST returns access_denied and asks the user to restart. A separate follow-up could let this POST request a fresh mapped login and keep the terminal check on its return GET. Previous POST · Current mismatch handling
Follow-up priority Low
Fixes #1262
A signed-out user had to enter the same device code twice when login interrupted verification. With this change, the user enters the code once, including when the client requests a non-default authentication chain.
The default verification URI identifies the issuing realm and includes the requested
acr_valuesas a hint for the first login. This lets a child realm on a shared hostname direct the browser to the right login. An existing URI without a realm still shows the code form first. Its POST uses the realm stored on the device code.If the initial login used a different chain, OpenAM uses the ACR stored on the submitted code to select the mapped chain. The login return URL carries an opaque handle bound to the browser's HTTP session. On return, OpenAM checks the session against the ACR requested for that code. If a custom login page returns the default chain again, the browser shows the required authentication method and the device stays pending. If the chain matches, the form restores the code for confirmation. The device remains pending until a CSRF-protected POST, and explicit consent still requires the user's approval.
Tests
acrclaim in the issued ID token.gotoleaves the device pending and shows an error naming the required ACR. A template that selects the mapped chain restores the submitted code and records the matchingacrin the ID token after confirmation.isConsentImpliedfromtruetofalse, and the browser displayed the consent prompt.