if you want to add attributes to cas protocol (though maybe you really
should follow marvins suggestion :) however sometimes the Saml11
protocol is behaving strangly i think so it might help you to use the
cas protocol with attributes even if it isnt suggested.
, what i did is to add the cas attributes tag to
casProxySuccessView.jsp (just as the cas user is added). since the
principal already has attributes in the code, then just add the
attributes at the spot where you want to include them. i think the
easiest way was to just put them to the convertedattributes list because
this is added to the principal which is sent out.
On 10/15/2010 9:35 PM, Jonathan Bricker wrote:
>
> I had to write accustom principal resolver for my authentication. I
> wanted to return some user attributes but I seem to be doing something
> wrong.
>
> Here is the code
>
> PersonCredentials.PersonCredential personCredentials =
> response.getPersonCredential();
>
> String principalId = personCredentials.getUsername();
>
> final Map<String, Object> attributes = new HashMap<String,
> Object>();
>
> attributes.put("PersonID", personCredentials.getPersonId());
>
> attributes.put("SubscriberKey",
> personCredentials.getSubscriberKey());
>
> return new SimplePrincipal(principalId, attributes);
>
> What I get back in the response on the client is just the username.
>
> <cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'>
>
> <cas:authenticationSuccess>
>
> <cas:user>someuser</cas:user>
>
> </cas:authenticationSuccess>
>
> </cas:serviceResponse>
>
> Do I need to use a client to get to the attributes or should they
> just be in the response as tags under the username?
>
> thanks
>
> *Jonathan Bricker*
>
> ExactTarget
>
> /Senior Software Engineer/
>
> Office | 317.524.2789
>
> Cell | 317.435.0763
>
> Email | [email protected] <mailto:[email protected]>
>
> --
> You are currently subscribed to [email protected] as:
> [email protected]
> To unsubscribe, change settings or access archives, see
> http://www.ja-sig.org/wiki/display/JSG/cas-user
--
You are currently subscribed to [email protected] as:
[email protected]
To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/display/JSG/cas-user