Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] RE: Attestation question

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] RE: Attestation question


Chronological Thread 
  • From: Tom Zeller <>
  • To: Nathan Kopp <>
  • Cc: "" <>
  • Subject: Re: [grouper-users] RE: Attestation question
  • Date: Fri, 6 May 2011 14:52:17 -0500
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=AKAefbx6tUKHg2dgfHSIIScApD8Uoc2gEC6aVlH6Mr40l15eLLNAnfKoHOISV1ECfp ULh0CthKQo2/vM2GxQIXW1o8HteHUEJZuE0FOYzdwSLdSjRyeF4UwCxkeDmyne9x/R3L iuOKUmxS+EeMZZ9k5J3NQAF7WdKYT3FmRIzw0=

>> I haven’t really discovered a consistent pattern that would help me to
>> understand the proper ways to use sessions.
>
> Anyways, as a rule you should start a GrouperSession as who you want to act
> as, either a regular subject or GrouperSystem.
>
> Another complication is things are only well defined for the UI, WS, and
> client.  The API is a free-for-all, which is why you are confused...

I, too, have wondered how to use grouper sessions properly in the API.

The data connector plugins for the shibboleth attribute resolver
re-use a private GrouperSession instance per DataConnector, which then
uses callbacks :

public class SomethingThatUsesSessions {

private GrouperSession grouperSession;

public GrouperSession getGrouperSession() throws {
if (grouperSession == null) {
grouperSession = GrouperSession.start(subject, false);
}
return grouperSession;
}

public void doSomething() {
GrouperSession.callbackGrouperSession(
getGrouperSession(), new GrouperSessionHandler() {
public void callback(GrouperSession grouperSession) throws
GrouperSessionException {
...do something...

I chose not to use ThreadLocals because each class using a
GrouperSession may have a different subject, i.e. a different user.

TomZ



Archive powered by MHonArc 2.6.16.

Top of Page