Bonjour,

j'ai développe un module d'authentification (java JASS) loginModule sous Jboss portal. j'ai développé une portlet user, je voulais recuperer l' userPrincipal et les roles associés dans la portlet.
l'authentification est bien réussie, le Pb dans le portlet je n'arrive pas à trouver les roles associé au userPrincipal,
voici le code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
public boolean login() throws LoginException {
 
        LOGGER.debug("login invoked");
 
        // only called (once!) after initialize
        Callback[] callbacks = getCallbacks();
 
        // Get the login
        String login = getLogin(callbacks);
 
        LOGGER.debug("login = " + login);
 
        if (login.length() > 0) {
            if (null == login || login.trim().length() == 0) {
                new FailedLoginException("Authentication Failed: User " + login + " doesn't exist.");
            }
 
            // Get the password
            String password = getPassword(login, callbacks);
 
            LOGGER.debug("password = " + password);
 
            // Authenticate user
 
            if (!loginSucceeded) {
                new FailedLoginException("Authentication Failed. Invalid username/password credentials.");
            } else {
                // Get user roles
                //identity = new SimplePrincipal(login);
                sharedState.put("javax.security.auth.login.name", login);
                roles.addAll(service.getRoles(login));
                identity = new ItcorePrincipal(login,roles);
                loginOk = true;
            }
        }
 
        return true;
    }
 
public List<String> getRoles(String login) {
 
        roles.add("Administrators");
        roles.add("itcore-portal");
        return roles;
}

vous avez une idée??
merci d'avance

a+