Repository navigation
[#1221] Characterize userinfo and tokeninfo token transport - #1239
Conversation
vharseko
left a comment
There was a problem hiding this comment.
[P1] Account for the CI user’s given_name in the form-body UserInfo test
The exact key assertion expects family_name, name, and sub. CI creates demo with givenName, and the previous build-docker run logged given_name: 'Demo' alongside those three claims. Restlet uses the same handler for GET and form POST, so the new assertion will reject a valid CI response. Please compare the form POST claims with the bearer-header GET response for the same token and keep the explicit POST status, content type, and subject checks. Assertion · Previous CI log
node --check and git diff --check passed. Playwright discovered all five new tests, and I confirmed that the new matcher rejects the claim set recorded in CI. Live E2E validation for this revision is pending. Current CI run
|
@vharseko Addressed this review in 96917b7785. The form-body UserInfo test now compares its full JSON response with a bearer-header GET using the same access token. The explicit POST HTTP 200, Local validation against OpenAM with embedded OpenDJ:
|
vharseko
left a comment
There was a problem hiding this comment.
Reviewed 96917b7785. The previous UserInfo finding is resolved. The form POST compares the full JSON response with a bearer-header GET using the same access token. Both requests require HTTP 200 with redirects disabled. The POST still checks the exact content type and expected subject. Updated test
node --check and git diff --check passed, and Playwright discovered all 10 tests. In a focused run with synthetic HTTP responses, the previous revision failed on the CI-shaped profile with given_name. The updated test passed with and without that claim, and failed as expected on a claim mismatch, a wrong subject, or a redirect from either request. The current CI run is still in the Maven matrix, with build-docker pending. CI run
Please update the PR description to record the GET/POST comparison in place of the three-key assertion and include the validation for 96917b7785. Follow-up validation
e33f48d
into
OpenIdentityPlatform:features/1075-remove-restlet
Part of #1221.
Base:
c3cefed8317776722cf30929152828b4849e0195. Final tested HEAD:96917b77859b7661edfe24271fa470687623d79d.Adds the b4a slice: five Restlet transport characterization tests ported from
59a89d07cc1d85dfdb3edeb2ceba4015b844073c:e2e/oauth2/oauth2-test.spec.mjs:308–390. They cover form-bodyuserinfo, query/headertokeninfo, and rejection when the same valid token is supplied twice. All five existing tests and all nine device-flow tests remain unchanged.The new group owns public client
test_client_oauth2_b4aand obtains its own token through a cookie-backed authorization-code exchange with S256 PKCE. Each test can run alone. All five transport cases and the reference bearer-header GET usemaxRedirects: 0so a new redirect cannot hide a changed HTTP contract. Missing admin authentication now fails setup instead of skipping it. Trace and screenshot capture are disabled for the file because these Playwright options are worker-scoped.Recorded contract and expectation changes
The five original status/error/grant/scope expectations all passed against the current Restlet implementation. No original expected result was replaced. The port adds stricter checks based on the live responses:
userinfo: HTTP 200,application/json;charset=UTF-8, and full JSON equality with a bearer-header GET using the same access token. The reference GET also requires HTTP 200; both requests disable redirects. The subject must equalUSERNAME. Comparing the complete responses preserves transport equivalence while allowing profile-dependent claims such asgiven_name.userinfo: HTTP 400,application/json, completeserver_errorwithAccess Token cannot be provided in both form and header. This preserves the existing defect; the comment names the targetinvalid_requestfrom RFC 6750 section 3.1.tokeninfo: HTTP 200,application/json, exactlyaccess_token,client_id,expires_in,grant_type,profile,realm,scope,token_type; checks bind the response to the issued token and owned client, requireauthorization_code, exact scope[profile], emptyprofile, root realm/,Bearer, and a positive integer lifetime no greater than the issued token lifetime. Token comparison uses a boolean assertion to keep failure messages free of bearer credentials.tokeninfo: HTTP 400,application/json, completeinvalid_requestwithAccess Token cannot be provided in both query and header.No production code, shared fixtures, provider configuration, or workflows change. b4b–b4d and b5 remain separate work.
Validation through
ea69082a89oauth2 uma xacmlsuite twice on its own fresh embedded OpenDJ stand: each run 137 passed, 0 failed, 0 skipped (nine files, parallel file execution, retries disabled).An additional shared run after the two full-file runs returned 136 passed / 1 failed / 0 skipped. The unchanged OIDC discovery test at
oidc-test.spec.mjs:136expectedopenid, but discovery still advertised[profile]even though the admin provider API contained all four required scopes. The standalone OAuth2 file had initialized the provider before the shared helpers widened its configuration;RealmOAuth2ProviderSettings.getSupportedScopes()caches the value. The result is consistent with stale cached provider settings; its frequency and reproduction on the base under identical scheduling have not been established. The planned shared pair therefore uses a separate fresh stand. The observed failure is retained in the local validation summary and execution ledger; the original raw log was overwritten by a later successful run. No shared-provider or discovery-test code was changed.An earlier review identified automatic redirect following as a coverage gap. With a temporary local proxy returning 307 before forwarding to the real OpenAM, all five tests passed before the fix. After disabling redirects, exactly five tests failed at their first status assertions (received 307, expected 200 or 400), with no skips. The proxy was stopped and is not part of the repository. Post-fix verification on the already configured embedded OpenDJ stand repeated the full file twice (10 passed each) and the shared suite twice (137 passed each), with zero failures or skips in all four runs.
Validation for
96917b7785givenName: Demo, matching the CI user profile. After the update, all 10 tests ine2e/oauth2/oauth2-test.spec.mjspassed with that profile, with 0 failures or skips. The updated test also passed withoutgivenName. See the local validation report.given_name, and rejects a claim mismatch, a wrong subject, or a redirect from either request. See the review.node --check,git diff --checkagainst the PR base, and Playwright discovery at this HEAD: all checks passed; 10 tests were discovered in the OAuth2 spec.44292021847completed successfully for this HEAD: all nine Maven matrix jobs,build-docker, and Trivy passed. The build-docker log confirms Playwright actually ran: the full suite with HttpOnly disabled reported 154 passed, 0 failed, and 1 skipped (the XUI HttpOnly step-up test). All 10 OAuth2 tests, including the five transport cases, passed without skips. The separate XUI run with HttpOnly enabled reported 3 passed, 0 failed, and 0 skipped.WAR provenance
Used the existing local WAR from CI Build run
43852682205, artifact14222035312, source commit097005086e3113fcd81c382f4aa080ec2f823cf4. SHA25639599c6caf586b5e31b4971a76548b135eaaa20b9c99ec57e148f55cf0718cdeverified both on disk and inside the test container. Compared with basec3cefed8317776722cf30929152828b4849e0195, only four e2e files differ; production sources are equivalent. The local image uses cacheds6-openam:b3b-baselinewith this verified WAR overlaid, and runs one OpenAM container with embedded OpenDJ. No WAR build or artifact download was performed.