-
1. Re: User Login
den74 Feb 13, 2007 4:36 AM (in response to works)> 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 -
2. Re: User Login
works Feb 13, 2007 9:26 AM (in response to works)Ok...but where i put that implementation?
I´m working with iframes in portlets....may i get the user logged using request.getUserPrincipal in the Jsp inside iframe?
Existi other method to do login, without extends UsersRolesLoginModule?
thanks -
3. Re: User Login
den74 Feb 14, 2007 2:56 AM (in response to works)> Ok...but where i put that implementation?
It is indipendend from portlet, i mean this way is always used to log in portal so you just need to make a jar and put into server/default/lib of jbossportal ( i made like this and it works)