Skip to Content.
Sympa Menu

grouper-users - [grouper-users] RE: Configure attributes for Grouper-WS calls

Subject: Grouper Users - Open Discussion List

List archive

[grouper-users] RE: Configure attributes for Grouper-WS calls


Chronological Thread 
  • From: "Klug, Lawrence" <>
  • To: Chris Hyzer <>, "Schreiber, Bernard" <>, "" <>
  • Subject: [grouper-users] RE: Configure attributes for Grouper-WS calls
  • Date: Tue, 9 Oct 2012 14:40:31 +0000
  • Accept-language: en-US

This is what I’m getting.  It’s not recognizing the uclaofficialemail – must not be configured.

 

gsh 2%  SubjectFinder.findByIdAndSource("urn:mace:ucla.edu:ppid:person:C4196E1230C9452191D7E416FC4BD

9F3", "ldap", true).getAttributes().keySet();

uclauniversityid

sn

uclalogonid

dn

displayname

edupersonprincipalname

edupersonaffiliation

uclappid

cn

gsh 3%  SubjectFinder.findByIdAndSource("urn:mace:ucla.edu:ppid:person:C4196E1230C9452191D7E416FC4BD

9F3", "ldap", true).getAttributes().uclaofficialemail

// Error: unable to evaluate command: Sourced file: inline evaluation of: `` SubjectFinder.findByIdA

ndSource("urn:mace:ucla.edu:ppid:person:C4196E1230C94521 . . . '' : reflection error: bsh.ReflectErr

or: No such field: uclaofficialemail

 

From: Chris Hyzer [mailto:]
Sent: Monday, October 08, 2012 5:16 PM
To: Klug, Lawrence; Schreiber, Bernard;
Subject: RE: Configure attributes for Grouper-WS calls

 

It’s a subject API config problem.  Open GSH from the WEB-INF/bin of your WS deployment, and try to resolve a subject and get the email out of it.  Then tweak your sources.xml or your attribute name until it works.   Ok?  J

 

gsh 0% GrouperSession.startRootSession();

edu.internet2.middleware.grouper.GrouperSession: 9a07d48c89604a2ca772945d4b57fdd0,'GrouperSystem','application'

gsh 1% SubjectFinder.findByIdAndSource("10021368", "pennperson", true).getAttributeValue("EMAIL");

gsh 3% SubjectFinder.findByIdAndSource("10021368", "pennperson", true).getAttributes().keySet();

name_last_public

preferred_first_name

first_name

name_first_public

name_public

email_public

pennname

email

description_lower

last_name

eppn

gsh 4%

 

Note, in the last call, I think they are toLowered()… I think we made the names case-insensitive recently…

 

Thanks,

Chris

 

From: Klug, Lawrence
Sent: Monday, October 08, 2012 5:25 PM
To: Chris Hyzer; Schreiber, Bernard;
Subject: RE: Configure attributes for Grouper-WS calls

 

Hi Chris,

 

Now we are getting one of our two attributes.  uclaLoginID is coming, but uclaOfficialEmail is not (see below).  What are we doing wrong?

 

Thanks,

 

Lawrence

 

 

ws.subject.result.detail.attribute.names = UCLAOFFICIALEMAIL,UCLALOGINID

 

{"WsGetMembersLiteResult":{"responseMetadata":{"millis":"4454","serverVersion":"2.1.2"},"resultMetadata":{"resultCode":"SUCCESS","resultMessage":"Success for: clientVersion: 2.1.1, wsGroupLookups: Array size: 1: [0]: WsGroupLookup[pitGroups=[],groupName=ucla:apps:cms:it:bernard_test]\n\n, memberFilter: All, includeSubjectDetail: false, actAsSubject: null, fieldName: null, subjectAttributeNames: Array size: 2: [0]: uclaofficialemail\n[1]: uclalogonid\n\n, paramNames: \n, params: null\n, sourceIds: null\n, pointInTimeFrom: null, pointInTimeTo: null","success":"T"},"subjectAttributeNames":["uclaofficialemail","uclalogonid"],"wsGroup":{"description":"bernard testing","displayExtension":"Bernard Test","displayName":"UCLA:Applications:CMS:IT:Bernard Test","extension":"bernard_test","name":"ucla:apps:cms:it:bernard_test","typeOfGroup":"group","uuid":"cc1efd71af924a76bd3350928015415b"},"wsSubjects":[{"attributeValues":["","lklug"],"id":"urn:mace:ucla.edu:ppid:person:C4196E1230C9452191D7E416FC4BD9F3","name":"KLUG, LAWRENCE","resultCode":"SUCCESS","sourceId":"ldap","success":"T"}]}}

 

From: Chris Hyzer []
Sent: Monday, October 08, 2012 11:02 AM
To: Chris Hyzer; Schreiber, Bernard; Klug, Lawrence;
Subject: RE: Configure attributes for Grouper-WS calls

 

I just tried this in our test system and it worked fine:

 

ws.subject.result.attribute.names = PENNNAME, EMAIL

 

 

[mchyzer@flash pennGroupsClient-2.0.0]$ java -jar grouperClient.jar --operation=getSubjectsWs --pennKeys=mchyzer --debug=true

 

################ REQUEST START (indented) ###############

 

POST /grouperWs/servicesRest/v2_0_000/subjects HTTP/1.1

Connection: close

Authorization: Basic xxxxxxxxxxxxxxxx

User-Agent: Jakarta Commons-HttpClient/3.1

Host: medley-test03.isc-seo.upenn.edu:-1

Content-Length: 171

Content-Type: text/xml; charset=UTF-8

 

<WsRestGetSubjectsRequest>

  <wsSubjectLookups>

    <WsSubjectLookup>

      <subjectIdentifier>mchyzer</subjectIdentifier>

    </WsSubjectLookup>

  </wsSubjectLookups>

</WsRestGetSubjectsRequest>

 

################ REQUEST END ###############

 

 

 

################ RESPONSE START (indented) ###############

 

HTTP/1.1 200 OK

Date: Mon, 08 Oct 2012 18:01:06 GMT

Server: Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8o proxy_html/3.1.2 mod_jk/1.2.31 PHP/5.2.17

Set-Cookie: JSESSIONID=xxxxxxxxxxxx; Secure

X-Grouper-resultCode: SUCCESS

X-Grouper-success: T

X-Grouper-resultCode2: NONE

Vary: Accept-Encoding

Content-Length: 728

Connection: close

Content-Type: text/xml;charset=UTF-8

 

<WsGetSubjectsResults>

  <subjectAttributeNames>

    <string>PENNNAME</string>

    <string>EMAIL</string>

  </subjectAttributeNames>

  <wsSubjects>

    <WsSubject>

      <identifierLookup>mchyzer</identifierLookup>

      <resultCode>SUCCESS</resultCode>

      <success>T</success>

      <id>10021368</id>

      <name>Michael Christopher Hyzer</name>

      <sourceId>pennperson</sourceId>

      <attributeValues>

        <string>mchyzer</string>

        <string>>

      </attributeValues>

    </WsSubject>

  </wsSubjects>

  <resultMetadata>

    <resultCode>SUCCESS</resultCode>

    <resultMessage>Queried 1 subjects</resultMessage>

    <success>T</success>

  </resultMetadata>

  <responseMetadata>

    <resultWarnings></resultWarnings>

    <millis>12088</millis>

    <serverVersion>2.1.1</serverVersion>

  </responseMetadata>

</WsGetSubjectsResults>

 

################ RESPONSE END ###############

 

 

From: Chris Hyzer
Sent: Monday, October 08, 2012 1:54 PM
To: 'Schreiber, Bernard'; Klug, Lawrence;
Subject: RE: Configure attributes for Grouper-WS calls

 

You should be able to set these in the grouper-ws.properties referencing attributes from the source.xml (note, maybe they have to be in all CAPS):

 

# subject attribute names to send back when a WsSubjectResult is sent, comma separated

# e.g. name, netid

# default is none

ws.subject.result.attribute.names =

 

# subject result attribute names when extended data is requested (comma separated)

# default is name, description

# note, these will be in addition to ws.subject.result.attribute.names

ws.subject.result.detail.attribute.names =

 

The former is by default.  The latter is when the called says they want subject details. 

 

We aren’t using those right now, so hopefully it works.

And callers should be able to request ones which aren’t there:

 

[mchyzer@flash pennGroupsClient-2.0.0]$ java -jar grouperClient.jar --operation=getSubjectsWs --pennKeys=mchyzer --subjectAttributeNames=EMAIL,PENNNAME --debug=true

DEBUG: Reading resource: grouper.client.properties, from: /home/mchyzer/grouper/pennGroupsClient-2.0.0/grouper.client.properties

DEBUG: WebService: connecting as user: 'something/school.edu'

DEBUG: WebService: connecting to URL: 'https://grouper.school.edu/grouperWs/servicesRest/v2_0_000/subjects'

 

################ REQUEST START (indented) ###############

 

POST /grouperWs/servicesRest/v2_0_000/subjects HTTP/1.1

Connection: close

Authorization: Basic xxxxxxxxxxxxxxxx

User-Agent: Jakarta Commons-HttpClient/3.1

Host: medley.isc-seo.upenn.edu:-1

Content-Length: 265

Content-Type: text/xml; charset=UTF-8

 

<WsRestGetSubjectsRequest>

  <subjectAttributeNames>

    <string>EMAIL</string>

    <string>PENNNAME</string>

  </subjectAttributeNames>

  <wsSubjectLookups>

    <WsSubjectLookup>

      <subjectIdentifier>mchyzer</subjectIdentifier>

    </WsSubjectLookup>

  </wsSubjectLookups>

</WsRestGetSubjectsRequest>

 

################ REQUEST END ###############

 

 

 

################ RESPONSE START (indented) ###############

 

HTTP/1.1 200 OK

Date: Mon, 08 Oct 2012 17:49:52 GMT

Server: Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8o mod_jk/1.2.31 PHP/5.2.17

Set-Cookie: JSESSIONID=xxxxxxxxxxxx; Secure

X-Grouper-resultCode: SUCCESS

X-Grouper-success: T

X-Grouper-resultCode2: NONE

Vary: Accept-Encoding

Content-Length: 727

Connection: close

Content-Type: text/xml;charset=UTF-8

 

<WsGetSubjectsResults>

  <subjectAttributeNames>

    <string>EMAIL</string>

    <string>PENNNAME</string>

  </subjectAttributeNames>

  <wsSubjects>

    <WsSubject>

      <identifierLookup>mchyzer</identifierLookup>

      <resultCode>SUCCESS</resultCode>

      <success>T</success>

      <id>10021368</id>

      <name>Michael Christopher Hyzer</name>

      <sourceId>pennperson</sourceId>

      <attributeValues>

        <string>>

        <string>mchyzer</string>

      </attributeValues>

    </WsSubject>

  </wsSubjects>

  <resultMetadata>

    <resultCode>SUCCESS</resultCode>

    <resultMessage>Queried 1 subjects</resultMessage>

    <success>T</success>

  </resultMetadata>

  <responseMetadata>

    <resultWarnings></resultWarnings>

    <millis>1262</millis>

    <serverVersion>2.1.1</serverVersion>

  </responseMetadata>

</WsGetSubjectsResults>

 

################ RESPONSE END ###############

 

 

DEBUG: Output template: Index: ${index}: success: ${success}, code: ${wsSubject.resultCode}, subject: ${wsSubject.id}

, available variables: wsGetSubjectsResults, grouperClientUtils, index, wsSubject, wsGroup, success

Index: 0: success: T, code: SUCCESS, subject: 10021368

DEBUG: Elapsed time: 2238ms

[mchyzer@flash pennGroupsClient-2.0.0]$

 

 

From: Schreiber, Bernard []
Sent: Monday, October 08, 2012 1:46 PM
To: Chris Hyzer; Klug, Lawrence;
Subject: RE: Configure attributes for Grouper-WS calls

 

Information on how to do both would be great.  For now all calls will need a custom login id and email address so definitely need to know how to configure it by default.

 


From: Chris Hyzer []
Sent: Monday, October 08, 2012 10:44 AM
To: Klug, Lawrence;
Cc: Schreiber, Bernard
Subject: RE: Configure attributes for Grouper-WS calls

You can do this by default, or only when the caller requests it.  Which do you want?

 

Thanks,

Chris

 

From: [] On Behalf Of Klug, Lawrence
Sent: Monday, October 08, 2012 1:43 PM
To:
Cc: Schreiber, Bernard
Subject: [grouper-users] Configure attributes for Grouper-WS calls

 

We want to configure grouper so that it returns specific attributes (for example, email address) using Grouper-WS REST calls.  Does this require special config, because so far it’s not working for us.

 

Thanks,

 

Lawrence




Archive powered by MHonArc 2.6.16.

Top of Page