Hi John,
I think the problem is in this test:
if (typeof extensionAttribute1 != "undefined" &&
extensionAttribute1 != null && extensionAttribute1 != "") {
in particular, this bit won't work:
extensionAttribute1 != ""
You need to use getValues() to extract the attribute value into a variable and test its length. So, assuming you know that there will always be no more than a single value for extensionAttribute1, I think the code would look something like the following.
if (typeof extensionAttribute1 != "undefined" && extensionAttribute1 != null) {
value = extensionAttribute1.getValues().get(0).length();
if (value > 0) {
print ("JH: set to staff: extensionAttribute1 value is: " + value);
}
}
I've tested that condition with my test IdP, but I haven't been able to get the print statement to work; perhaps there's something I need to do to my tomcat logging settings. It will certainly set an IdP attribute value according to the result of the test.
Cheers,
Sara
UK federation
On 26/02/2014 12:56, John Horne wrote:
> On Tue, 2014-02-25 at 09:53 +0000, Andy Swiffin wrote:
>> Oooh, I remember being here once before some time ago. Let me just
>> see if I can find the scars...
>>
> Thanks for the replies.
>
> A quick update is that the attributes 'typeof' is being returned as
> 'object'. Whether that is an actual array or not I can't say. Secondly,
> it seems that our LDAP call is not returning all the attributes for a
> user. The idp-process log file states that certain LDAP attributes are
> resolved with 'containing 0 values', with no corresponding 'Found the
> following attribute' log record. (Doing a manual LDAP query shows that
> the relevant attribute does have a value.) So I'm currently wondering if
> perhaps too much data is being returned and truncated(?), or if there is
> something on the backend Active Directory side that is preventing all
> the data being sent.
>
>
>
>
> John.
>
--
Sara Hopkins
Support Team
UK Access Management Federation for Education and Research
web: http://www.ukfederation.org.uk/
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
|