Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-5282

SyncopeLoginModule should support Syncope 2.x response format

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.2, 4.2.0.M1
    • Component/s: karaf
    • Labels:
      None

      Description

      The current SyncopeLoginModule supports Syncope 1.x, especially with the roleName tag.

      Typically, a Syncope 1.x response looks like:

      <?xml version="1.0" encoding="utf-8" standalone="yes"?>
      
      <syncope:user xmlns:syncope="http://syncope.apache.org/1.2">
      
            <creationDate>2017-08-01T10:36:44.943+02:00</creationDate>
      
            <creator>admin</creator>
      
            <lastChangeDate>2017-08-01T10:42:17.935+02:00</lastChangeDate>
      
            <lastModifier>unauthenticated</lastModifier>
      
            <attributes/>
      
            <derivedAttributes/>
      
            <id>100</id>
      
            <virtualAttributes/>
      
            <propagationStatuses/>
      
            <resources/>
      
            <failedLogins>0</failedLogins>
      
            <lastLoginDate>2017-08-01T10:42:17.933+02:00</lastLoginDate>
      
            <memberships>
      
                  <membership>
      
                        <creationDate>2017-08-01T10:36:44.948+02:00</creationDate>
      
                        <creator>admin</creator>
      
                        <lastChangeDate>2017-08-01T10:36:44.948+02:00</lastChangeDate>
      
                        <lastModifier>admin</lastModifier>
      
                        <attributes/>
      
                        <derivedAttributes/>
      
                        <id>100</id>
      
                        <virtualAttributes/>
      
                        <roleId>100</roleId>
      
                        <roleName>admin</roleName>
      
                  </membership>
      
            </memberships>
      
            <password>680165E46BA08D53077806144F87A4369974778B</password>
      
            <status>active</status>
      
            <username>sadok</username>
      
      </syncope:user>
      

      Whereas now with Syncope 2.x, the response looks like:

      {
      
         "@class":"org.apache.syncope.common.lib.to.UserTO",
      
         "creator":"admin",
      
         "creationDate":"2017-07-31T08:36:41.000+0000",
      
         "lastModifier":"admin",
      
         "lastChangeDate":"2017-08-01T08:46:19.236+0000",
      
         "key":"e5a131b0-eb66-4115-a131-b0eb66511579",
      
         "type":"USER",
      
         "realm":"/karaf",
      
         "status":"created",
      
         "password":null,
      
         "token":null,
      
         "tokenExpireTime":null,
      
         "username":"herve",
      
         "lastLoginDate":"2017-08-01T08:46:19.224+0000",
      
         "changePwdDate":null,
      
         "failedLogins":0,
      
         "securityQuestion":null,
      
         "securityAnswer":null,
      
         "mustChangePassword":false,
      
         "auxClasses":[
      
       
      
         ],
      
         "plainAttrs":[
      
       
      
         ],
      
         "derAttrs":[
      
       
      
         ],
      
         "virAttrs":[
      
       
      
         ],
      
         "resources":[
      
       
      
         ],
      
         "roles":[
      
            "admin"
      
         ],
      
         "dynRoles":[
      
            "admin"
      
         ],
      
         "relationships":[
      
       
      
         ],
      
         "memberships":[
      
            {
      
               "type":"Membership",
      
               "rightType":"GROUP",
      
               "rightKey":"3847aa78-3202-4d8f-87aa-7832026d8fba",
      
               "groupName":"manager",
      
               "plainAttrs":[
      
       
      
               ],
      
               "derAttrs":[
      
       
      
               ],
      
               "virAttrs":[
      
       
      
               ]
      
            }
      
         ],
      
         "dynGroups":[
      
       
      
         ]
      
      }
      

      roles is now a JSON array.

      I will create two SyncopeLoginModule: Syncope1LoginModule and Syncope2LoginModule.

        Attachments

          Activity

            People

            • Assignee:
              jbonofre Jean-Baptiste Onofré
              Reporter:
              jbonofre Jean-Baptiste Onofré
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: