Repository navigation
JAXB3 Migration #1023
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
Open
maximthomas
wants to merge
31
commits into
OpenIdentityPlatform:master
Choose a base branch
from
maximthomas:features/jaxb3-update-2026-05-19
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
JAXB3 Migration #1023
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
2e4170f
JAXB3 migration
maximthomas 80f2d77
fix liberty errors
maximthomas 815f1a7
REST SAML STS E2E test
maximthomas 63ff444
Merge branch 'master' into features/jaxb3-update-2026-05-19
vharseko dac13f3
Fix ClassCastException in WSFederationCOTUtils.removeFromEntityConfig…
vharseko 9e8cad2
Fix ClassCastException in multi-protocol SOAP single logout after JAX…
vharseko ea473f7
Fix ClassCastException in SP single logout after JAXB3 migration
vharseko 6a4d814
Fix ClassCastException in SAML2 attribute query value conversion afte…
vharseko 3435063
Fix ClassCastException reading hosted entity config in OpenFM workflo…
vharseko 271ad11
Fix NullPointerException on KeyDescriptor without "use" in console af…
vharseko faf0be2
Fix invalid SAML2 metadata endpoints generated by console after JAXB3…
vharseko d9d4b8e
Fix NullPointerException for entities without affiliation config in I…
vharseko 5aa4d1c
Fix NullPointerException reading optional Liberty Personal Profile el…
vharseko f77dbb7
Fix NullPointerException on unknown issuer in OAuth2 SAML2 bearer gra…
vharseko f168117
Fix IDP proxy authn-context matching after JAXB3 migration
vharseko f3bafac
Merge remote-tracking branch 'origin/master' into pr1023
vharseko 07b3fe2
Remove leftover Git conflict markers in comment headers
vharseko a18c3c1
Fix JAXB3 migration call-site bugs and finish build cleanup
vharseko 07b3585
Fix JAXB3 migration NPE regressions in config/metadata unwrapping
vharseko 3f330bd
Defer DatatypeFactory creation to a lazy holder in Time
vharseko 89062d3
Unwrap JAXB3 element wrappers in Liberty IDPP and Discovery flows
vharseko 8aecaa1
Merge origin/master into features/jaxb3-update-2026-05-19
vharseko 2139ffc
Merge remote-tracking branch 'origin/master' into features/jaxb3-upda…
vharseko d020a36
Fix JAXB3 migration review findings: SLO ClassCastException, WS-Fed c…
vharseko c457695
Merge remote-tracking branch 'origin/master' into features/jaxb3-upda…
maximthomas be0714b
Fix JAXB3 mixed-content ClassCastException and pin review fixes
maximthomas e5f73db
Pin the Discovery entry read path in DiscoEntryHandlerImplUtils
maximthomas 2fa7241
Restore JAXB 1 namespace layout and strict unmarshalling for federati…
maximthomas 149fce2
Stop JAXB 3 metadata round trips from growing and dropping roles
maximthomas 838dbcc
Merge remote-tracking branch 'origin/master' into features/jaxb3-upda…
maximthomas 29db51a
Fix CodeQL errors on lines touched by the JAXB 3 migration
maximthomas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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,170 @@ | ||
| /* | ||
| * The contents of this file are subject to the terms of the Common Development and | ||
| * Distribution License (the License). You may not use this file except in compliance with the | ||
| * License. | ||
| * | ||
| * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the | ||
| * specific language governing permission and limitations under the License. | ||
| * | ||
| * When distributing Covered Software, include this CDDL Header Notice in each file and include | ||
| * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL | ||
| * Header, with the fields enclosed by brackets [] replaced by your own identifying | ||
| * information: "Portions copyright [year] [name of copyright owner]". | ||
| * | ||
| * Copyright 2026 3A Systems, LLC. | ||
| */ | ||
|
|
||
| import { test, expect } from "@playwright/test"; | ||
| import { resolve } from "path"; | ||
| import { fileURLToPath } from "url"; | ||
|
|
||
| // ─── Configuration ──────────────────────────────────────────────────────────── | ||
| const BASE_URL = process.env.OPENAM_BASE_URL ?? "http://openam.example.org:8080/openam"; | ||
| const ADMIN_USER = process.env.OPENAM_ADMIN_USER ?? "amadmin"; | ||
| const ADMIN_PASS = process.env.OPENAM_ADMIN_PASS ?? "ampassword"; | ||
|
|
||
| const STS_INSTANCE_NAME = "openam-to-saml-sts"; | ||
| const SP_ENTITY_ID = "https://sp.example.com"; | ||
| const SP_ACS_URL = "https://sp.example.com/acs"; | ||
|
|
||
| const __filename = fileURLToPath(import.meta.url); | ||
| const __dirname = resolve(__filename, ".."); | ||
|
|
||
| // Get admin token | ||
| async function getAuthToken(request, username, password) { | ||
| const resp = await request.post(`${BASE_URL}/json/authenticate`, { | ||
| headers: { | ||
| "Content-Type": "application/json", | ||
| "X-OpenAM-Username": username, | ||
| "X-OpenAM-Password": password, | ||
| "Accept-API-Version": "resource=2.0, protocol=1.0", | ||
| } | ||
| }); | ||
| const json = await resp.json(); | ||
| return json.tokenId; | ||
| } | ||
|
|
||
| // ─── Tests ──────────────────────────────────────────────────────────────────── | ||
| test.describe("REST STS - OpenAM Token → SAML2", () => { | ||
|
|
||
| let adminToken; | ||
|
|
||
|
|
||
| async function stsExists(request) { | ||
| const response = await request.get(`${BASE_URL}/sts-publish/rest`, { | ||
| headers: { | ||
| "Content-Type": "application/json", | ||
| "iPlanetDirectoryPro": adminToken | ||
| }, | ||
| }); | ||
|
|
||
| if(!response.ok()) { | ||
| return false; | ||
| } | ||
| const json = await response.json(); | ||
| return !!json[STS_INSTANCE_NAME] | ||
| } | ||
|
|
||
| async function setupSts(request) { | ||
| const payload = { | ||
| invocation_context: "invocation_context_client_sdk", | ||
| instance_state: { | ||
| "deployment-config": { | ||
| "deployment-url-element": STS_INSTANCE_NAME, | ||
| "deployment-realm": "/", | ||
| "deployment-auth-target-mappings": {} | ||
| }, | ||
| "saml2-config": { | ||
| "issuer-name": `${BASE_URL}`, | ||
| "saml2-sp-entity-id": SP_ENTITY_ID, | ||
| "saml2-sp-acs-url": SP_ACS_URL, | ||
| "saml2-signature-key-alias": "test", | ||
| "saml2-sign-assertion": "false", | ||
| "saml2-encrypt-assertion": "false", | ||
| "saml2-encrypt-attributes": "false", | ||
| "saml2-encrypt-nameid": "false", | ||
| "saml2-name-id-format": "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent", | ||
| "saml2-token-lifetime-seconds": "600", | ||
| "saml2-encryption-algorithm-strength": "128", | ||
| "saml2-attribute-map": { | ||
| "email": "mail" | ||
| } | ||
| }, | ||
| "persist-issued-tokens-in-cts": "false", | ||
| "supported-token-transforms": [ | ||
| { | ||
| "inputTokenType": "OPENAM", | ||
| "outputTokenType": "SAML2", | ||
| "invalidateInterimOpenAMSession": false | ||
| } | ||
| ], | ||
| "token-lifetime": 600 | ||
| } | ||
| }; | ||
|
|
||
| const response = await request.post(`${BASE_URL}/sts-publish/rest?_action=create`, { | ||
| headers: { | ||
| "Content-Type": "application/json", | ||
| "iPlanetDirectoryPro": adminToken | ||
| }, | ||
| data: payload | ||
| }); | ||
|
|
||
| expect(response.ok()).toBeTruthy(); | ||
| const body = await response.json(); | ||
| console.log("REST STS instance created:", body); | ||
| expect(body).toHaveProperty("_id"); | ||
| } | ||
|
|
||
| test.beforeAll(async ({ request }) => { | ||
| adminToken = await getAuthToken(request, ADMIN_USER, ADMIN_PASS); | ||
| expect(adminToken).toBeTruthy(); | ||
| console.log(`Admin token obtained: ${adminToken.slice(0, 20)}...`); | ||
| const haveSts = await stsExists(request) | ||
| if(!haveSts) { | ||
| await setupSts(request); | ||
| } | ||
| }); | ||
|
|
||
|
|
||
| test("should translate OpenAM token to SAML2 assertion", async ({ request }) => { | ||
|
|
||
| const userSession = await getAuthToken(request, "demo", "changeit"); | ||
|
|
||
| const translatePayload = { | ||
| input_token_state: { | ||
| token_type: "OPENAM", | ||
| session_id: userSession | ||
| }, | ||
| output_token_state: { | ||
| token_type: "SAML2", | ||
| subject_confirmation: "BEARER" | ||
| } | ||
| }; | ||
|
|
||
| const response = await request.post( | ||
| `${BASE_URL}/rest-sts/${STS_INSTANCE_NAME}?_action=translate`, | ||
| { | ||
| headers: { | ||
| "Content-Type": "application/json", | ||
| "iPlanetDirectoryPro": userSession | ||
| }, | ||
| data: translatePayload | ||
| } | ||
| ); | ||
|
|
||
| expect(response.ok()).toBeTruthy(); | ||
| const result = await response.json(); | ||
|
|
||
| expect(result).toHaveProperty("issued_token"); | ||
| const assertion = result.issued_token; | ||
|
|
||
| console.log(`SAML Assertion received: ${assertion.substring(0, 300)}...`,); | ||
|
|
||
| // Basic XML validation | ||
| expect(assertion).toContain("<saml:Assertion"); | ||
| expect(assertion).toContain(`<saml:Issuer>${BASE_URL}`); | ||
| expect(assertion).toContain(SP_ENTITY_ID); | ||
| }); | ||
|
|
||
| }); |
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
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.
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.