1) Membership in Apache Syncope
Users and "Any Objects" can be members of Groups in two ways - statically and dynamically. "Static" membership is when the User or "Any Object" is explicitly assigned membership of a given Group. "Dynamic" membership is when the Group is defined with a set of rules, which if they evaluate to true for a given User or "Any Object", then that User or "Any Object" is a member of the group. For example, a User could be a dynamic member of a group based on the value for a given User attribute. So we could have an Apache group with a dynamic User membership rule of "*@apache.org" matching an "email" attribute.
2) Exploring group membership via the REST API
Let's examine group membership with some practical examples. Start Apache Syncope and log in to the admin console. Click on "Groups" and add a new group called "employee", accepting the default options. Now click on the "User" tab and add new Users called "alice" and "bob", with static membership of the "employee" group.
Using a tool like "curl", we can access the REST API using the admin credentials to obtain information on "alice":
- curl -u admin:password http://localhost:9080/syncope/rest/users/alice
- curl -u admin:password http://localhost:9080/syncope/rest/groups/employee
Now consider obtaining the membership count of a given group. Let's say we are interested in finding out how many employees we have - how can this be done? Prior to Apache Syncope 2.0.7, we have to leverage the power of FIQL which underpins the search capabilities of the REST API of Apache Syncope:
- curl -u admin:password http://localhost:9080/syncope/rest/users?fiql=%24groups==employee
- curl -u admin:password http://localhost:9080/syncope/rest/groups/employee
- staticUserMembershipCount: The static user membership count of a given group
- dynamicUserMembershipCount: The dynamic user membership count of a given group
- staticAnyObjectMembershipCount: The static "Any Object" membership count of a given group
- dynamicAnyObjectMembershipCount: The dynamic "Any Object" membership count of a given group.
No comments:
Post a Comment