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

SocialProviderHandlerNode does not work from an upgraded AM

    XMLWordPrintable

    Details

    • Rank:
      1|i056ja:
    • Yes
    • No
    • Yes and I used the same an in the description

      Description

      Bug description

      When upgrading from AM 7.0.0, 7.0.* to 7.1.0 that is clean (did not do any configuration) and then upgrade to AM 7.1.0. So this new AM7.1.0 from an upgrade no longer if later used and SocialProviderHandlerNode is used will not work.

      It will throw the following exception

      o.f.o.a.t.e.NodeFactory: 2021-07-12 11:39:56,266: Thread[http-nio-0.0.0.0-8080-exec-6]: TransactionId[737b539c-b8e4-4418-89c3-ec1082ac279d-15508]
      ERROR: Could not get Config for type SocialProviderHandlerNode node with id 0bf47721-400f-4d59-834c-bfa01915d044 in realm /msazure
      java.lang.IllegalStateException: Failed to load configuration for SocialProviderHandlerNode
      [CONTINUED]     at org.forgerock.openam.sm.annotations.InstanceBuilder.build(InstanceBuilder.java:170)
      [CONTINUED]     at org.forgerock.openam.sm.annotations.InstanceBuilder.buildInstance(InstanceBuilder.java:145)
      [CONTINUED]     at org.forgerock.openam.sm.annotations.InstanceBuilder.buildInstance(InstanceBuilder.java:82)
      [CONTINUED]     at org.forgerock.openam.sm.SmsAnnotatedServiceRegistry.getRealmInstance(SmsAnnotatedServiceRegistry.java:410)
      [CONTINUED]     at org.forgerock.openam.auth.trees.engine.NodeFactory.getConfigForNode(NodeFactory.java:181)
      [CONTINUED]     at org.forgerock.openam.auth.trees.engine.NodeFactory.createNode(NodeFactory.java:126)
      [CONTINUED]     at org.forgerock.openam.auth.trees.engine.AuthTreeExecutor.process(AuthTreeExecutor.java:131)
      [CONTINUED]     at org.forgerock.openam.auth.trees.engine.AuthTreeExecutor.process(AuthTreeExecutor.java:196)
      [CONTINUED]     at org.forgerock.openam.core.rest.authn.trees.AuthTrees.processTree(AuthTrees.java:458)
      .....
      Caused by: java.lang.IllegalStateException: Expecting a single value
              at org.forgerock.openam.sm.annotations.adapters.AdapterUtils.validateSingleValue(AdapterUtils.java:36)
              at org.forgerock.openam.sm.annotations.adapters.EnumTypeAdapter.convertFromStrings(EnumTypeAdapter.java:73)
              at org.forgerock.openam.sm.annotations.AnnotatedAttribute.convertFromString(AnnotatedAttribute.java:71)
              at org.forgerock.openam.sm.annotations.InstanceBuilder.convertConfigToInstanceValues(InstanceBuilder.java:206)
              at org.forgerock.openam.sm.annotations.InstanceBuilder.convertConfigToInstanceValues(InstanceBuilder.java:191)
              at org.forgerock.openam.sm.annotations.InstanceBuilder.build(InstanceBuilder.java:161)
              ... 128 common frames omitted
      

      How to reproduce the issue

      1. Install AM 7.0.1/2
      2. Stop it
      3. Now upgrade to AM 7.1.0
      4. Now configure a simple SocialProviderHandlerNode
      Expected behaviour
      An upgraded AM7.0 instance works fine.
      
      Current behaviour
      An upgraded AM from AM7.0 will have these issues and no longer work. In fact doing a fresh install of only AM7.1.0 works.
      

      Work around

      This may need to update the AM schema for SocialProviderHandlerNode

      Code analysis

      There is a schema change from AM 7.0 to AM 7.1, yet there is no bump in the Node version nor Node upgrade done.

      Below is the SSOADM snippet of SocialProviderHandlerNode
      (format adjusted so can see the difference)

      Upgraded:

      <Service name="SocialProviderHandlerNode"  version="1.0" ><Schema i18nFileName="org/forgerock/openam/auth/nodes/SocialProviderHandlerNode"  i18nKey="nodeDescription"  resourceName="SocialProviderHandlerNode"  revisionNumber="1"  serviceHierarchy="/DSAMEConfig/SocialProviderHandlerNode" ><Organization><SubSchema i18nKey="nodeDescription"  inheritance="multiple"  name="instance"  resourceName="USE-PARENT" >
      
      <AttributeSchema i18nKey="script"  name="script"  order="100"  resourceName="script"  syntax="string"  type="single_choice"  uitype="scriptSelect"  validator="RequiredValueValidator" ><ChoiceValues><ChoiceValuesClassName className="org.forgerock.openam.scripting.service.ScriptChoiceValues" ><AttributeValuePair><Attribute name="ContextId" ></Attribute><Value>SOCIAL_IDP_PROFILE_TRANSFORMATION</Value></AttributeValuePair></ChoiceValuesClassName></ChoiceValues></AttributeSchema>
      
      <AttributeSchema i18nKey="usernameAttribute"  name="usernameAttribute"  order="300"  resourceName="usernameAttribute"  syntax="string"  type="single"  validator="RequiredValueValidator" ><DefaultValues><Value>userName</Value></DefaultValues></AttributeSchema>
      
      <AttributeSchema name="RequiredValueValidator"  syntax="string"  type="validator" ><DefaultValues><Value>com.sun.identity.sm.RequiredValueValidator</Value></DefaultValues></AttributeSchema>
      ...
      

      Fresh:

      </SubConfiguration></OrganizationConfiguration></Configuration></Service>
      <Service name="SocialProviderHandlerNode"  version="1.0" ><Schema i18nFileName="org/forgerock/openam/auth/nodes/SocialProviderHandlerNode"  i18nKey="nodeDescription"  resourceName="SocialProviderHandlerNode"  revisionNumber="1"  serviceHierarchy="/DSAMEConfig/SocialProviderHandlerNode" ><Organization><SubSchema i18nKey="nodeDescription"  inheritance="multiple"  name="instance"  resourceName="USE-PARENT" ><AttributeSchema i18nKey="script"  name="script"  order="100"  resourceName="script"  syntax="string"  type="single_choice"  uitype="scriptSelect"  validator="RequiredValueValidator" ><ChoiceValues><ChoiceValuesClassName className="org.forgerock.openam.scripting.service.ScriptChoiceValues" ><AttributeValuePair><Attribute name="ContextId" ></Attribute><Value>SOCIAL_IDP_PROFILE_TRANSFORMATION</Value></AttributeValuePair></ChoiceValuesClassName></ChoiceValues></AttributeSchema>
      
      <AttributeSchema i18nKey="usernameAttribute"  name="usernameAttribute"  order="300"  resourceName="usernameAttribute"  syntax="string"  type="single"  validator="RequiredValueValidator" ><DefaultValues><Value>userName</Value></DefaultValues></AttributeSchema>
      
      
      <AttributeSchema i18nKey="clientType"  name="clientType"  order="400"  resourceName="clientType"  syntax="string"  type="single_choice" ><ChoiceValues><ChoiceValue i18nKey="clientType.BROWSER" >BROWSER</ChoiceValue><ChoiceValue i18nKey="clientType.NATIVE" >NATIVE</ChoiceValue></ChoiceValues><DefaultValues><Value>BROWSER</Value></DefaultValues></AttributeSchema>
      
      
      <AttributeSchema name="RequiredValueValidator"  syntax="string"  type="validator" ><DefaultValues><Value>com.sun.identity.sm.RequiredValueValidator</Value></DefaultValues></AttributeSchema>
      
      </SubSchema></Organization></Schema><Configuration><OrganizationConfiguration group="default" name="/msazure"><SubConfiguration name="57ddc8e0-4042-4eb6-b06c-3136f28d18ac" id="instance"><AttributeValuePair>
          <Attribute name="script"/>
      

      Note that the following extra schema

      <AttributeSchema i18nKey="clientType"  name="clientType"  order="400"  resourceName="clientType"  syntax="string"  type="single_choice" ><ChoiceValues><ChoiceValue i18nKey="clientType.BROWSER" >BROWSER</ChoiceValue><ChoiceValue i18nKey="clientType.NATIVE" >NATIVE</ChoiceValue></ChoiceValues><DefaultValues><Value>BROWSER</Value></DefaultValues></AttributeSchema>
      

      Adding this thru LDAP works.

        Attachments

          Activity

            People

            chee-weng.chea C-Weng C
            chee-weng.chea C-Weng C
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: