Setting group via REST for multiple community members
I need to set the group membership for the staff of my organization and of course remove it when someone leaves the organization. It's important to us that comments by staff members are shown as such in the community. We have a Lithium SSO with another web site that is accessed by our "Customers" and our staff. I recognize full well that the proper way to set the group membership is at the time the SSO is initialized for a member and cookie written. However I'm unable to do that because my web site doesn't know which members are staff. Changing the site would require major changes to my web site by vendors and that would be costly and take time. So I am pursuing setting it on a regular basis via a "batch" update.
Im looking for help from the community in doing this in the best way possible. It looks like the way to do this with Lithium is via REST. Admittedly I'm not 100 sure this is possible I'm just assuming it is. So here is the plan:
I will write a C# .NET console application that will run on a scheduled basis and will do the following.
- Extract the SSO ID's from my source database for employees.
- Obtain a valid SSO key using the .NET SSO client.
- Connect to REST using the session key that would normally be written to the cookie.
- Extract all members of the employee group from Lithium via REST using the SSOID.
- Compare.
- Set the group for all new employees.
- Remove it for departed ones via REST.
- Any insight into the proper way to accomplish this would be appreciated!