grouper-users - [grouper-users] Using the Java Client API
Subject: Grouper Users - Open Discussion List
List archive
- From: Dan Sellars <>
- To: "" <>
- Subject: [grouper-users] Using the Java Client API
- Date: Tue, 1 Oct 2013 16:09:56 -0400
- Accept-language: en-US
- Acceptlanguage: en-US
Hello, I am new to using Grouper and I am currently investigating and prototyping to see if it will fit our needs. Identity management is a fairly new subject area to me, so there may be a lot of background information
that I am lacking around what I am trying to do. Basically I want a system that I can use to manage the authentication of users. Grouper seems to fit what I need but I am having trouble working out some basic functionality. So I appreciate any help you can provide. Firstly, do I need to use an external Subject repository such as LDAP for a small deployment or is it possible to use the internal 'subject' and 'subjectattribute' tables? If so: How do I add a new Subject via the java client api? The only ways I have seen are by using gsh or an sql script. I have tried to use something like the following from my web app: GcAddMember addMember = new GcAddMember(); WsSubjectLookup actAsSubject = new WsSubjectLookup("GrouperSystem", null, null); addMember.assignActAsSubject(actAsSubject); addMember.addSubjectId(username.toLowerCase().replaceAll(" ", ".")); addMember.addSubjectIdentifier(username); addMember.assignGroupName("qsuob:all"); addMember.assignAddExternalSubjectIfNotFound(true); WsAddMemberResults wsResult = addMember.execute(); But this gives an exception: edu.internet2.middleware.subject.SourceUnavailableException: Cant find source with id: 'grouperExternal', Possible source id's: 'g:gsa',
'grouperEntities', 'jdbc', 'g:isa', This part of the API seems to be more about just adding an existing subject to a group, which I have successfully managed to do. So I am unsure where to look next. How do I read attributes about a Subject? For example I want to have an email address attribute and once I have found a Subject then be able to retrieve the email address from it. I have tried the following but to no effect, I am not even sure if I am
using the API correctly. WsSubjectLookup lookup = new WsSubjectLookup(); lookup.setSubjectId(username); WsGetAttributeAssignmentsResults attrs = new GcGetAttributeAssignments().addOwnerSubjectLookup(lookup).execute();
When I try this I get an exception like: java.lang.RuntimeException: attributeAssignType is required: edu.internet2.middleware.grouperClient.api.GcGetAttributeAssignments@187f73e5 I have tried to look for somewhere that I could set the attribute type but could not find it. I have managed to retrieve a Subject based on it's subject id using: WsSubjectLookup lookup = new WsSubjectLookup(); lookup.setSubjectId(username); WsGetSubjectsResults sResults = new GcGetSubjects().addWsSubjectLookup(lookup).assignIncludeSubjectDetail(true).execute(); Is this the most efficient way of doing it? If there is some more documentation around this or specific examples of these kind of fairly basic tasks then just pointing me there would be great. I have been hunting around the website here https://spaces.internet2.edu/display/Grouper/Grouper+Client, here https://spaces.internet2.edu/display/Grouper/Subject+API, watched the related video tracks and downloaded the source to look at the client API so I am not sure where to go next. Thanks in advance, Dan. |
- [grouper-users] Using the Java Client API, Dan Sellars, 10/01/2013
- Re: [grouper-users] Using the Java Client API, Tom Barton, 10/01/2013
- Re: [grouper-users] Using the Java Client API, Dan Sellars, 10/02/2013
- Re: [grouper-users] Using the Java Client API, Tom Barton, 10/02/2013
- Re: [grouper-users] Using the Java Client API, Dan Sellars, 10/02/2013
- <Possible follow-up(s)>
- Re: [grouper-users] Using the Java Client API, Chris Hyzer, 10/02/2013
- Re: [grouper-users] Using the Java Client API, Tom Barton, 10/01/2013
Archive powered by MHonArc 2.6.16.