Jean-Baptiste Onofré created KARAF-5282:
-------------------------------------------

             Summary: SyncopeLoginModule should support Syncope 2.x response 
format
                 Key: KARAF-5282
                 URL: https://issues.apache.org/jira/browse/KARAF-5282
             Project: Karaf
          Issue Type: Improvement
          Components: karaf-security
            Reporter: Jean-Baptiste Onofré
            Assignee: Jean-Baptiste Onofré
             Fix For: 4.2.0, 4.1.2


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

Typically, a Syncope 1.x response looks like:

{code}
<?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>
{code}

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

{code}
{

   "@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":[

 

   ]

}
{code}

{{roles}} is now a JSON array.

I will create two {{SyncopeLoginModule}}: {{Syncope1LoginModule}} and 
{{Syncope2LoginModule}}.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to