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

Reply via email to