[jboss-user] [JBoss Portal] - Re: User Login

den74 do-not-reply at jboss.com
Tue Feb 13 04:36:06 EST 2007


> How do I login in the portal using this users?

I have solved a similar problem after some tests, implementing my MyLoginModule that  extends UsersRolesLoginModule and in this redefined some methds:
(only some part of code)

// to save locally the user
protected String[] getUsernameAndPassword() throws LoginException {
  String[] userAndPassword = super.getUsernameAndPassword();
  this.user = userAndPassword[0];			
  return userAndPassword;
}

// to use my validation
protected boolean validatePassword(String arg0, String arg1) {   
  boolean result = myValidation.login(this.user, arg0);
  return result;
}

remember you have to configure portal to use your class:
in jbPortal/server/default/conf/login-config.xml
add you application policy like


    <application-policy name = "My_Authentication">
       
          <login-module code ="it.deltadator.security.auth.spi.MyLoginModule"
             flag = "required" >
            <module-option name="additionalRole">Authenticated</module-option>
          </login-module>
       
    </application-policy>

and then use it as security domain changing reference in 
server\default\deploy\jboss-portal.sar\portal-server.war\WEB-INF\jboss-web.xml

> How i get the user logged? 

In your class you can access to user logged using getUserPrincipal from ProtletRequest


hope you get it useful

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4015679#4015679

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4015679



More information about the jboss-user mailing list