Transcoding of object type of claim fails
Description
Environment
Activity

Philip Smart April 4, 2025 at 4:22 PM
Technically, this could be solved in the RP for now, as that controls the claim going into the Transcoder.

Philip Smart April 4, 2025 at 4:06 PMEdited
Speaking to Scott, it might be OK for a patch to convert the LinkedTreeMap
into the expected JSONObject before it hits the transcoder.
Also, I’ll speak to @Henri about testing this from his real OP instance.
Scott Cantor March 31, 2025 at 12:27 PM
Certainly in the bigger picture, having a dedicated API to wrap and expose JSON messages is the closest analog to what was done for SAML, and the Transcoding layer was definitely designed around that idea.
One way around it might be to instantuate a delegating object implementing a dedicated marker interface and be able to get at the different representations we have to accomodate in the different cases, so the Transcoders would operate on that marler type but get at the guts via a separate method internally.
Then the transcoders would know for certain they were given an object intentionally to process.

Philip Smart March 28, 2025 at 4:37 PM
This was not easy to test because the the OIDCStringAttributeTranscoder
encodedType is a JSONObject. So, I did not go through the usual TranscoderRegistry and instead called the decodeValues
method of the OIDCStringAttributeTranscoder
directly with the LinkedTreeMap
.
I think the best option here with the least change would be to add an if clause that tests for a Map and serialises that Map to a JSON string value (just as it does for a JSON Object).

Philip Smart March 28, 2025 at 11:54 AM
Yes, the decode method does not understand that type, as you say. Both are java.util.Map
s. I’ll take a look.
Details
Assignee
Philip SmartPhilip SmartReporter
jlauros@csc.fijlauros@csc.fiComponents
Details
Details
Assignee

Reporter

OIDC RP uses transcoder to decode received claims before storing them to subject. This fails if the incoming claims is of type Object. OIDCStringAttributeTranscoder class expects such claims to be of type ‘
net.minidev.json.JSONObject
’ but they actually are of type 'com.nimbusds.jose.shaded.gson.internal.LinkedTreeMap
'. As a result claim is silently lost in transcoding process and never stored to Subject even if having a transcoder of presumably correct type.