Uploaded image for project: 'OpenAM'
  1. OpenAM
  2. OPENAM-13221

Agent profile attribute mapping does not allow to map the same profile attribute to different header names

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 11.0.0, 11.0.1, 11.0.2, 11.0.3, 12.0.0, 12.0.1, 12.0.2, 12.0.3, 12.0.4, 13.0.0, 13.5.0, 13.5.1, 13.5.2, 14.0.0, 14.1.0, 14.1.1, 14.5.0, 14.5.1, 5.5.1, 6.0.0, 6.0.0.1
    • Fix Version/s: None
    • Component/s: sms
    • Labels:
    • Environment:
      Oracle JDK 1.8.0_151-b12
      Apache Tomcat/9.0.8
      AM 6.0.0
    • Sprint:
      AM Sustaining Sprint 52, AM Sustaining Sprint 53
    • Story Points:
      1
    • Support Ticket IDs:

      Description

      Bug description

      Different applications (behind HTTP reverse-proxy with agent) may await the information about the logged in user in different HTTP header names.

      Currently this is not allowed as there a map-validator is used only allowing unique keys.

      The agent itself handles this kind of mapping correctly.

      How to reproduce the issue

      Details steps outlining how to recreate the issue (remove this text)

      1. Configure AM
      2. Create Agent profile (Web or J2EE)
      3. Add profile attribute mapping uid=CustomID
      4. Add profile attribute mapping uid=LoginID
      5. Save agent profile
      Expected behaviour
      Agent profile should be saved without error
      
      Current behaviour
      Console shows "Plug-in com.sun.identity.idm.plugins.internal.AgentsRepo: Error while setting attributes for agentonly"
      

      Work around

      Set  'DuplicateKeyMapValueValidator' validator the for sub-schema 'WebAgent' and 'J2EEAgent'

       
      ssoadm set-attr-validator -u amadmin -f PATH_TO_PWDFILE -s AgentService -t Organization -c WebAgent -a com.sun.identity.agents.config.profile.attribute.mapping -r com.sun.identity.common.configuration.DuplicateKeyMapValueValidator
      
      ssoadm set-attr-validator -u amadmin -f PATH_TO_PWDFILE -s AgentService -t Organization -c J2EEAgent -a com.sun.identity.agents.config.profile.attribute.mapping -r com.sun.identity.common.configuration.DuplicateKeyMapValueValidator
      

      Code analysis

      AgentService.xml
                          <AttributeSchema
                                  name="com.sun.identity.agents.config.profile.attribute.mapping"
                                  type="list"
                                  syntax="string"
                                  uitype="maplist"
                                  validator="MapValueValidator"
                                  i18nKey="a413"
                                  order="14900" resourceName="profileAttributeMap">
                              <DefaultValues>
                                  <Value>[]=</Value>
                              </DefaultValues>
                          </AttributeSchema>
      

      should be changed to

      Text                    <AttributeSchema
                                  name="com.sun.identity.agents.config.profile.attribute.mapping"
                                  type="list"
                                  syntax="string"
                                  uitype="maplist"
                                  validator="DuplicateKeyMapValueValidator"
                                  i18nKey="a413"
                                  order="14900" resourceName="profileAttributeMap">
                              <DefaultValues>
                                  <Value>[]=</Value>
                              </DefaultValues>
                          </AttributeSchema>
      

      for SubSchema 'WebAgent' and 'J2EEAgent'.

       

      This was forgotten in the fix for OPENAM-4495

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                joe.starling Joe Starling
                Reporter:
                bthalmayr Bernhard Thalmayr
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: