Repository navigation
Conversation
…ng authorization and code exchange
maximthomas
left a comment
There was a problem hiding this comment.
praise: The Playwright case checks that the fixed query survives the authorization redirect and that the same URI works in the code exchange.
issue (blocking): Preserve every explicitly registered callback spelling for exact matching.
RedirectUriValidator.java:70–72
A client can register both https://APP.example.org/callback and https://app.example.org/callback. The profile stores both strings, but the read path converts them to a HashSet<URI>, where Java considers the two spellings equal. The base validator accepted both through URI.equals. The new string comparison sees only the retained spelling and rejects the other with redirect_uri_mismatch. Preserve the registered strings for exact comparison and parse them for loopback port matching. Registration write path · Registration read path · Base validator
Closure criterion — each exact spelling is accepted when both are registered, including fixed queries that differ only in percent-escape hex case. With only one spelling registered, reject an alternate spelling for a non-loopback callback. Keep the existing supported loopback port forms.
maximthomas
left a comment
There was a problem hiding this comment.
see the comment below
… during validation and resolution
|
@maximthomas, 008d1fb addresses the registered callback spelling issue. The validator and resolver now receive one URI per distinct registered string. This preserves host case and percent-escape hex case for exact matching and retains the existing loopback port rules. Regression tests exercise both examples from your review. With both spellings registered, either succeeds. With only one registered, the alternate is rejected. Omitting |
maximthomas
left a comment
There was a problem hiding this comment.
praise: The new tests pass numbered identity attributes through the real client registration and validator, covering both host case and percent-escape hex case.
issue (blocking): Preserve existing pairwise sub values when building the redirect URI set.
OpenAMClientRegistration.java:148–154
For a pairwise client without sector_identifier_uri, getSubValue() can hash the host spelling of the first URI in the set. The previous getter filled a default HashSet incrementally, while the new getter sizes the set from the number of strings before URI.equals deduplicates them. An unchanged profile with 13 registered spellings, 12 distinct URI values and mixed case on the same hostname switched from app.example.org to APP.example.org on JDK 11 and 21, giving the same user a different sub in ID tokens and UserInfo and breaking the relying party’s existing account association. Keep the incremental set construction on the legacy getter used by pairwise subject generation and keep the spelling-preserving collection for validation and resolution. Previous getter · Subject calculation · OIDC claim stability
Closure criterion — the same stored redirect URIs, user and salt produce the same non-null sub as on a502c7a8ac for the mixed-case fixture, with both registered spellings still accepted by the validator.
…xed-case redirect URIs
|
@maximthomas, 31be36b restores incremental insertion into the redirect URI set used by The regression test uses a pairwise client without a |
maximthomas
left a comment
There was a problem hiding this comment.
praise: The regression test pins the previously issued pairwise subject and checks that the same registration accepts both explicit callback spellings.
Fixes #714
OpenAM removed the query from the requested redirect URI before comparing it with the registered URI. A client that registered and sent the same callback with a fixed query could therefore get
redirect_uri_mismatch. At code exchange, OpenAM removed the query from the URI associated with the authorization code, causinginvalid_grantwhen the client repeated the original URI.Both checks now compare the complete URI, including the query. Native applications can still use the supported loopback port forms. Clients that previously appended parameters to a registered callback must register the full URI for fixed parameters or associate per-request context with OAuth
state. The upgrade guide covers this change.OpenAM preserves every explicitly registered callback spelling during authorization, including differences in host case and percent-escape hex case. If both spellings are registered, either can be requested and the client must specify which one to use. The same rule applies to callbacks derived from CDSSO agent roots.
For pairwise OIDC clients without a
sector_identifier_uri, OpenAM again adds each redirect URI to an initially empty set when choosing the host for the subject identifier. This preserves thesubused by relying parties to identify existing users when registered callbacks contain different spellings of the same host.Verification
openam-oauth2passed on JDK 11 at31be36b51f. Regression tests cover both registered spellings, rejection of an unregistered spelling, omission of an ambiguous redirect URI, and callbacks resolved from CDSSO agent roots.subas ona502c7a8ac, and the validator accepts both registered spellings of the callback.a502c7a8ac), two Playwright tests passed against a local OpenAM 16.1.4 container with the two updated classes. The first checked thatidp_id=1survived the redirect and exchanged the code for an access token. The second used that token at the UserInfo endpoint.