You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I read the OpenAM documentation and I'm not seeing a way to remove a group to a user using the OpenAM Rest API.
Right now to remove a group we use this API: PUT /openam/json/{RealmName}/groups/{GroupName} removing the user in the uniqueMember list.
For example we have a group with the name mygroup that contains three users: myuser1@foobar.com, seconduser@foobar.com and toremove@foobar.com.
And we want to remove the user toremove@foobar.com of the group mygroup,
to do it we execute this API:
As you can see we remove the user toremove@foobar.com from the list uniqueMember .
But this is not ideal, because we have to load all the users (that belong to a group) into memory (and if we have a lot of users this could generate a bad performance in the API and also the service that is calling this API could consume a lot of memory RAM) and then remove the user in the list uniqueMember.
This approach also could generate a race condition for example: if two processes are trying to delete different users at the same time then one process can override the uniqueMember when invokes the API PUT /openam/json/{RealmName}/groups/{GroupName} .
Do you know if there is a better way to remove a group to a user? (I mean, for a specific user X I want to delete the group G, maybe an API that takes two parameters the username and the group and remove the user of the group ?)
Regards,
Martín.
The text was updated successfully, but these errors were encountered:
Added `setGroups` action to the user REST endpoint.
Pass group names array in the `groups` request body property
see the example below:
```bash
curl --location --request POST 'http://openam.example.org:8080/openam/json/realms/root/users/demo?_action=setGroups' \
--header 'Content-Type: application/json' \
--header 'iPlanetDirectoryPro: AQIC5wM2LY4....1MTk4AAJTMQAA*' \
--data-raw '{
"groups": ["managers", "group1"]
}'
```
Hello,
I read the OpenAM documentation and I'm not seeing a way to remove a group to a user using the OpenAM Rest API.
Right now to remove a group we use this API:
PUT /openam/json/{RealmName}/groups/{GroupName}
removing the user in theuniqueMember
list.For example we have a group with the name
mygroup
that contains three users:myuser1@foobar.com
,seconduser@foobar.com
andtoremove@foobar.com
.And we want to remove the user
toremove@foobar.com
of the groupmygroup
,to do it we execute this API:
As you can see we remove the user
toremove@foobar.com
from the listuniqueMember
.But this is not ideal, because we have to load all the users (that belong to a group) into memory (and if we have a lot of users this could generate a bad performance in the API and also the service that is calling this API could consume a lot of memory RAM) and then remove the user in the list
uniqueMember
.This approach also could generate a race condition for example: if two processes are trying to delete different users at the same time then one process can override the
uniqueMember
when invokes the APIPUT /openam/json/{RealmName}/groups/{GroupName}
.Do you know if there is a better way to remove a group to a user? (I mean, for a specific user
X
I want to delete the groupG
, maybe an API that takes two parameters theusername
and thegroup
and remove the user of the group ?)Regards,
Martín.
The text was updated successfully, but these errors were encountered: