Repository navigation
[#1221] e2e characterization tests for OIDC checkSession and endSession - #1234
Merged
maximthomas merged 7 commits intoNov 17, 2026
Conversation
…2/connect/checkSession
…2/connect/endSession
…ssionURI checkSession test
…ore the redirect URI
…checkSession GETs
maximthomas
marked this pull request as ready for review
November 12, 2026 11:43
vharseko
approved these changes
Nov 12, 2026
vharseko
left a comment
Member
There was a problem hiding this comment.
Reviewed PR #1234 at 1171ada, including the PR description and the scope defined in #1221, #1223, and #1075.
No actionable findings. The added tests and fixtures are consistent with the current Restlet handlers and the stated characterization scope.
Validation: both changed JavaScript files pass node --check, and the patch passes git apply --check --whitespace=error. The build-docker CI job passed for this commit, including both Playwright stages. I did not rerun the live e2e suite locally.
maximthomas
changed the base branch from
master
to
features/1075-remove-restlet
November 16, 2026 10:52
maximthomas
merged commit Nov 17, 2026
22c3d74
into
OpenIdentityPlatform:features/1075-remove-restlet
11 checks passed
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.
Why
#1221 (a step of #1075) pins the HTTP contract of
/oauth2with e2e tests that pass on master, where Restlet still serves/oauth2. The endpoint families then move to CHF one PR at a time. A test that passes unchanged after a move is that PR's parity proof, and any expectation a move changes must be a divergence listed in that PR.This is the second part of #1221: the OIDC session endpoints
connect/checkSessionandconnect/endSession. The first part, #1222, covered discovery,connect/jwk_uri, id_token issuance andidtokeninfo. This PR adds no production code.What
e2e/oauth2/oidc-test.spec.mjs: 13 tests in two new describes,OIDC checkSession(7) andOIDC endSession(6). The file grows from 11 to 24 tests.e2e/common/oauth2-fixtures.mjs: the fixtures they need.The 13 tests are lines 204-599 of
e2e/oauth2/oidc-test.spec.mjsat maximthomas/OpenAM@59a89d07cc, the parent ofbccbc9c4d9, which moved/oauth2to CHF on the abandonedfeatures/restlet-migrationbranch of the fork. They are the 13 tests #1222 left for this PR. On the branch they sat in two describes,OIDC session endpoints(3 tests) and the "5-E3" contract lock (10 rows); here they are grouped by endpoint, and the row numbers and the branch's plan references are gone from the titles and comments./oauth2/connect/checkSession serves the session-management iframethe bare path is the JSP and the realm-prefixed path is the Restlet pagecheckSession answers GET and POST identicallyan id_token in the Referer supplies the client's originan unusable id_token in the Referer leaves the origin emptya client without a clientSessionURI leaves the origin emptycheckSession answers a display other than page with a 400/oauth2/connect/endSession requires an id_token_hint/oauth2/connect/endSession accepts a valid id_token_hinta registered post_logout_redirect_uri redirects, with the state in the queryan unregistered or relative post_logout_redirect_uri is a 400a malformed id_token_hint or an unparsable post_logout_redirect_uri is a 400PUT on checkSession and endSession is a 405 that names the allowed methodsFixtures
POST_LOGOUT_REDIRECT_URI(http://app.invalid/logout) andPOST_LOGOUT_REDIRECT_URI_WITH_QUERY(http://app.invalid/logout?ui=1):ensureOidcClientregisters both as the client's post-logout redirect URIs. endSession accepts apost_logout_redirect_urionly when the registered set contains it exactly, so the variant with a query is registered on its own.CLIENT_SESSION_URI(http://rp.invalid):ensureOidcClientregisters it as the client'sclientSessionURI, the origin the checkSession page acceptspostMessagecalls from.ensureNoSessionUriOidcClient: a confidential client without aclientSessionURI, as the admin API creates one by default. It sharesOIDC_CLIENT_SECRET, so a test can sign an HS256 id_token for it locally that passes checkSession's signature check.oidcSessionlogsdemoin and runs the authorization_code flow for an id_token. The checkSession describe calls it once; the endSession tests call it once per request that carries a validid_token_hint, 8 times in all.Changed expectations
The branch file as is (its 20 tests: the 7 of #1222 and these 13), run against master: 17 passed and 3 failed, twice on one container. All three answers changed on master in
d8cb3dac7c(GHSA-6f8c-crwq-jqm3), which madeCheckSessionrender the page for an id_token it cannot use instead of throwing, and made endSession reject an unparsable hint itself:an unusable id_token in the Referer leaves the origin empty(row 6d). Branch: 400server_errorJSON for an id_token withoutaud, with an unknownaud, and for a malformed one. Master: 200text/html;charset=UTF-8, the page withvar clientURI = "";andvar validSession = false;, for all three.a client without a clientSessionURI leaves the origin empty(row 6e). Branch: 400server_errorJSON. Master: 200, the same page.a malformed id_token_hint or an unparsable post_logout_redirect_uri is a 400(row 10). Branch: 400server_errorwith Restlet's "Internal Server Error (500) - ..." text, for a malformed hint with the registered URI and for the same hint with an unparsable URI. Master: 400{"error":"bad_request","error_description":"The id_token_hint is not a valid signed JWT"}for both. A new case sends a valid hint with the unparsable URI, and master answers 400{"error":"redirect_uri_mismatch","error_description":"The redirection URI provided does not match a pre-registered value."}.Framework values no longer pinned
Server: Restlet-Framework/2.4.4on the Restlet page and its absence on the JSP.error_descriptionof the 400 (Bad Request (400) - Server can not serve the content of authorization pageforpopup,touchandwap;Internal Server Error (500) - ...for an unknown value): Restlet's status text. The status, the exactContent-Type, the member set (error,error_description) anderror(server_error) stay pinned.{"code":405,"reason":"Method Not Allowed","message":...}), itsContent-Typeand its missing cache headers. The status andAllowstay pinned:GET, POSTfor checkSession andGETfor endSession, compared as a set because Restlet lists them in reflection order.Assertions tightened beyond the branch
All values were recorded from master.
Content-Typeis asserted exactly on every answer with a body:text/html;charset=UTF-8for every page, andapplication/jsonwithout a charset for every endSession error and thedisplay400. The branch checked it exactly only on the two pages of row 6 and ondisplay=page, withtoContainon the iframe and the JSON errors, and not at all on rows 6b and 6c and the missing-hint error.requires an id_token_hint, row 9, row 10). The branch checkederroranderror_descriptionfield by field.X-Frame-Options. The relying party frames this page, andSecurityHeadersexcludes/connect/checkSession.clientSessionURIgets that origin, so the empty origin of this row is the registration's. A token the signature check refused would get the same empty-origin page.display=bogusjoins the loop withpopup,touchandwap, anddisplay=pagemust answer the same page as nodisplayat all.%2For a bare/for the slash instate, because its CHF port encoded it differently. Master answershttp://app.invalid/logout?state=st%20ate%2F1, and that exactLocationis pinned. A move that changes it lists the change.Defects pinned as master answers them
Each carries a comment that names the target.
var validSession = "false";, a quoted string, so!validSessionis false and the page reads the session cookie even when the session is not valid. Target:var validSession = false;, as the Restlet page underrealms/already emits it. The branch pinned the same value.displayother thanpageanswers 400server_error.check_session_iframehas nodisplayparameter in OpenID Connect Session Management 1.0; Restlet resolves one as for an authorization page and fails. Target: 200 with the same page as without the parameter.How it was checked locally
The image was
FROM openidentityplatform/openam:latestwith the WAR replaced, configured the waybuild-dockerconfigures it (embedded stores locally; CI uses an external OpenDJ user store). The WAR is a local full build of master3b050dcd99. Since then master has changed nothing under any module'ssrc/mainexceptopenam-documentation.EndSession.doCatchcalls the 4-argumentExceptionHandler.handle, the error-page overload; in this resource it answers a 500/oauth2/connect/endSession requires an id_token_hint,a registered post_logout_redirect_uri redirects, with the state in the query,an unregistered or relative post_logout_redirect_uri is a 400,a malformed id_token_hint or an unparsable post_logout_redirect_uri is a 400EndSession.validateRedirectchecks the client's redirection URIs instead of its post-logout redirect URIsCheckSessionas it was befored8cb3dac7can unusable id_token in the Referer leaves the origin empty,a client without a clientSessionURI leaves the origin emptyOpenIDConnectCheckSessionEndpointwithout@PostcheckSession answers GET and POST identically,PUT on checkSession and endSession is a 405 that names the allowed methodsEndSession.validateRedirectchecks the client's redirection URIs, and a request withoutpost_logout_redirect_urianswers 200{}instead of 204/oauth2/connect/endSession accepts a valid id_token_hint(200),a registered post_logout_redirect_uri redirects, with the state in the query(400redirect_uri_mismatch),an unregistered or relative post_logout_redirect_uri is a 400(302 forREDIRECT_URI)CheckSession.getClientSessionURIanswers""for a usable id_tokenan id_token in the Referer supplies the client's origin,a client without a clientSessionURI leaves the origin empty(its control)EndSessionparsespost_logout_redirect_uribefore it verifies the hinta malformed id_token_hint or an unparsable post_logout_redirect_uri is a 400(redirect_uri_mismatchfor the unparsable URI)EndSessionchecks that apost_logout_redirect_uriit can parse is absolute before it verifies the hinta malformed id_token_hint or an unparsable post_logout_redirect_uri is a 400(relative_redirect_urifor the relative URI)WAR 1: 8 failed, 16 passed. WAR 2: 3 failed, 21 passed. WAR 3: 2 failed, 22 passed. WAR 4 and WAR 5: 1 failed, 23 passed. The 11 tests of #1222 stayed green under all five.
Three tests stay green under every mutant, because what they catch lies outside these classes: the iframe test catches an unmapped JSP (404), the JSP/Restlet test a
web.xmlthat sends the bare path to Restlet (an absolute script src and an unquoted flag), and thedisplaytest a page that ignoresdisplay(200).e2e/oauth2,e2e/umaande2e/xacmltogether, twice on one fresh container: 94 passed in both runs (oidc 24, oauth2-test 5, device-flow-test 9, webfinger 19, uma 14, xacml 23). No master spec turned red next to this one.Tests for
/oauth2behaviour that neither the branch nor this spec covers are #1223.Part of #1221.