>>> On 14/08/2009 at 16:47, in message <7B3B6ED735DC424E80C5ADB87727047C@HP>, Rod
Widdowson <[log in to unmask]> wrote:
> Nullnss is a different capability from presense. In the example I think
> you'll find that memberOf is *always* available in AD and so that if doesn't
>
> do anything
>
> I think that you will need to check for the attribute being present before
> you use the variable. I've not done a huge amount of Shib2 scriplet work
> but I'd try something like:
>
> if (requestContext.getAttributes().containsKey("groupMembership")) {
> bla;
> }
Thanks Rod, that works great. I suspected that AD must be doing something like that or else other people would have already noticed!
Jim Fox from washington also offers (in response to the same question posted on the I2 list):
if (typeof groupMembership != "undefined") {...}
which also works, essentially doing the same I believe (?), testing if the very essence of the attribute groupMembership exists rather than looking for it to be null (but in existence).
I have a further question though, how and where do I find out that I can do things like you and Jim did above? It all looks like a black art to me, is it because I'm not a Java whizz or is there a bit of a hole in the documentation?
> And if that didn't work I'd start printf'ing the context of gettAttributes()
> to see what happened..
??? Is this a suggestion to go into the Shib2 Java code?
I'd kind of got the idea that Shib 2 was going to be a whole lot easier to drive than the previous one, IMHO its proving not to be the case. It does concern me that we are trying to promote "federation" at every level of educational service provision, but if access to someone with long hair and sandals is going to be required for each install its going to scare a lot of people off.
Cheers
Andy
> And if that didn't work I'd start printf'ing the context of gettAttributes()
>
> to see what happened..
The University of Dundee is a registered Scottish charity, No: SC015096
|