indigo-iam / iam

INDIGO Identity and Access Management Service
https://indigo-iam.github.io/
Other
99 stars 43 forks source link

Fix authorization on SCIM me endpoint and improve SCIM user extension #764

Closed enricovianello closed 3 weeks ago

enricovianello commented 2 months ago

Fixes #748 and #763.

SCIM me endpoint AuthZ was not working without scopes. Now authenticated users can retrieve again their info without problems. In addition, our SCIM user extension "IndigoUser" has been extended in order to add:

In order to include managed groups into SCIM users details you need to enable them through the property:

scim:
  include_managed_groups: true

or through the environment variable:

IAM_SCIM_INCLUDE_MANAGED_GROUPS=true

Attributes can be included into SCIM user response in the same way the labels are:

scim.include_attributes[0].name=attribute-name
scim.include_attributes[1].name=another-attribute-name

SCIM me output example:

{
   "id":"80e5fb8d-b7c8-451a-89ba-346ae278a66f",
   "meta":{ ... },
   "schemas":[
      "urn:ietf:params:scim:schemas:core:2.0:User",
      "urn:indigo-dc:scim:schemas:IndigoUser"
   ],
   ...
   "urn":"indigo-dc:scim:schemas:IndigoUser":{
      "oidcIds":[ ... ]
      "samlIds":[ ... ],
      "isAdmin": "false",
      "attributes":[
         {
            "name":"nickname",
            "value":"tester"
         }
      ],
      "endTime": "2024-08-06T02:00:00.000+02:00",
      "managedGroups":[
         {
            "display":"Analysis",
            "value":"6a384bcd-d4b3-4b7f-a2fe-7d897ada0dd1",
            "$ref":"http://localhost:8080/scim/Groups/6a384bcd-d4b3-4b7f-a2fe-7d897ada0dd1"
         },
         {
            "display":"Production",
            "value":"c617d586-54e6-411d-8e38-64967798fa8a",
            "$ref":"http://localhost:8080/scim/Groups/c617d586-54e6-411d-8e38-64967798fa8a"
         }
      ]
   }
}
sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
92.2% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud