Affiliation data is available through WIND only by special request. Since affiliation information may be considered student records, CUIT management must approve of your access to this data. In addition, these data are generally restricted to Columbia departments or organizations.
If you believe that you need access to user affiliation information, you should describe exactly which affiliations you would like returned and why they are needed. A list of the affiliations that can be returned is available at:
http://www.columbia.edu/acis/rad/authmethods/auth-affils/
Affiliation Request
There is one parameter to the affiliation request, and that is the ticket.
ticketid The value of the ticket string sent by the user.
The affiliation request URI will look something like this:
https://wind.columbia.edu/validate?ticketid=TICKETID_TO_BE_VALIDATED
response
The response to the affiliations request is similar to the response to the authentication request. The response will be contained in a <wind:serviceResponse> element. On success, this will have a <wind:authenticationSuccess> element containing the username within <wind:user> tags, followed by a list of affiliations for that user (if any), within <wind:affiliations> tags. On failure, the response will be identical to the standard authentication failure.
The WIND server also supports the old-style plain-text responses to affiliation requests. Like a standard request, WIND will return either "yes" followed by a carriage return and the UNI (or anonymous WIND identifier) associated with that ticket, or "no". If the reponse is "yes", the UNI or WIND identifier will be followed by a carriage return separated list of affiliations.
Below is a sample valid XML response from WIND to a request for affiliations for a user:
<wind:serviceResponse xmlns:wind='http://www.columbia.edu/acis/rad/authmethods/wind'>
<wind:authenticationSuccess>
<wind:user>UNI</wind:user>
<wind:affiliations>
<wind:affil>affil1</wind:affil>
<wind:affil>affil2</wind:affil>
<wind:affil>affil3</wind:affil>
</wind:affiliations>
<wind:passwordtyped>true</wind:passwordtyped>
<wind:logintime>1078117200</wind:logintime>
<wind:passwordtime>1072933200</wind:passwordtime>
<wind:passwordchangeURI>
https://www1.columbia.edu/sec/acis/manageaccount/passwd.html
</wind:passwordchangeURI>
</wind:authenticationSuccess>
</wind:serviceResponse>
The same response from WIND in plain-text format:
yes
UNI
affil1
affil2
affil3
In the above examples, WIND has returned "yes" (this is a valid ticket), "UNI" (the UNI), and a newline-separated list of affiliations.
sample client code (parsing the XML response)
#
# Ticket validation and affils parsing subroutine
#
# $affiliationURI = 'https://wind.columbia.edu/validate?ticketid=';
#
sub ticketAffils {
use LWP::Simple 'get';
use XML::Simple;
my $ticketId = shift;
my $windResponse;
$windResponse = LWP::Simple::get($affiliationURI.$ticketId);
my $ref = XMLin($windResponse);
if (exists $ref->{'wind:authenticationSuccess'}) {
my $username = $ref->{'wind:authenticationSuccess'}{'wind:user'};
if (exists $ref->{'wind:authenticationSuccess'}{'wind:affiliations'}) {
my @affils = values %{$ref->{'wind:authenticationSuccess'}{'wind:affiliations'};
foreach my $aff (@affils) {
print "$aff\n";
}
}
else {
print "no affiliations returned for $username.\n";
}
} elsif (exists $ref->{'wind:authenticationFailure'}){
# Ticket rejected. User should have an option to try again.
# To try again, another authentication request needs to be generated.
print "the ticket was already used or was invalid";
} else {
# Unexpected response
print "did not receive an expected response";
}
}
The Perl code fragment above shows how an application might obtain the list of affiliations for a ticketid from an XML-format response.