Thank you for replying Michael! Like I suspected... I would have to tweak the internals since I could not find any simple API to do it for me...
One more question. At which point do you invoke your custom methods? After I set up my Restful API for the CAS. I followed this example ( http://www.dzone.com/snippets/cas-restful-java-client) to get authenticated and to retrieve the ticket and such. Thank you Al On Sat, Apr 5, 2014 at 1:52 AM, Michael Wechner <[email protected]>wrote: > I have written my own PrincipalResolver based on > > CredentialsToPrincipalResolver > > in order to return the firstname of the user: > > public final Principal resolvePrincipal(final Credentials credentials) { > > final Map<String, Object> attributes = new HashMap<String, > Object>(); > > attributes.put("firstname", ((MyFirstnamePasswordCredentials) > credentials).getFirstame()); > > return new SimplePrincipal(principalId, attributes); > } > > whereas I have overritten > > RememberMeUsernamePasswordCredentials > > by adding methods like for example > > getFirstname() > > and > > setFirstname(String firstname) > > > whereas setFirstname() is then used in my custom implementation of > > > AbstractUsernamePasswordAuthenticationHandler.authenticateUsernamePasswordInternal(final > UsernamePasswordCredentials credentials) > > > HTH > > Michael > > > > > Am 05.04.14 03:31, schrieb Al Krinker: > > Anyone has an example of how I can get a username from CAS (not from jsp > > request.getPrinciple())? > > > > trying to make restful call to CAS and then read in username returned. > > > > Also, trying to read other attributes like surname, firstname, ec... any > > examples will be appreciated as well > > > > > -- > 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
