You might want to checkout trunk, that now has integrated Seam security
for both identity and acl.
Mark
KEVIN_CHEONG(a)CRGL-THIRDPARTY.COM wrote:
Hi,
I finally have time to work on this again.
I was looking around in the Seam tutorials (security topic) and I found out how to write
a custom class for security. I'm starting out with a really simple example and I have
attached the code I am using below. My issue now is that I don't know where the class
is to be placed in the drools-brms war file that is being edited. I have tried placing it
alongside the other security files (package: org.drools.brms.server.security), but that
isn't working. It seems to me like there is some other config file which needs to be
edited to provide the name of the additional class? Any help will be really appreciated.
Thanks!
In my components.xml file:
<security:identity authenticate-method="#{authenticator.authenticate}"
/>
This is the java class:
package org.drools.brms.server.security;
import org.jboss.seam.security.Identity;
import org.jboss.seam.annotations.*;
@Name("authenticator")
public class Authenticator {
private static final String valid_user = "admin";
private static final String valid_password = "password";
public boolean authenticate() {
String username = Identity.instance().getUsername();
String password = Identity.instance().getPassword();
if((username.equals(valid_user)) && (password.equals(valid_password))) {
return true;
}
return false;
}
}
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users