[jboss-cvs] jboss-seam/examples/seamspace/src/org/jboss/seam/example/seamspace ...
Shane Bryzak
Shane_Bryzak at symantec.com
Tue Jan 30 18:46:00 EST 2007
User: sbryzak2
Date: 07/01/30 18:46:00
Modified: examples/seamspace/src/org/jboss/seam/example/seamspace
Authenticator.java
Log:
modified authentication method to throw exception
Revision Changes Path
1.5 +4 -5 jboss-seam/examples/seamspace/src/org/jboss/seam/example/seamspace/Authenticator.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Authenticator.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/seamspace/src/org/jboss/seam/example/seamspace/Authenticator.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- Authenticator.java 27 Jan 2007 14:25:31 -0000 1.4
+++ Authenticator.java 30 Jan 2007 23:46:00 -0000 1.5
@@ -6,6 +6,7 @@
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
+import javax.security.auth.login.LoginException;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
@@ -28,7 +29,8 @@
@Out(required = false, scope = SESSION)
private Member authenticatedMember;
- public boolean authenticate(String username, String password, Set<String> roles)
+ public void authenticate(String username, String password, Set<String> roles)
+ throws LoginException
{
try
{
@@ -43,13 +45,10 @@
for (MemberRole mr : authenticatedMember.getRoles())
roles.add(mr.getName());
}
-
- return true;
}
catch (NoResultException ex)
{
- FacesMessages.instance().add("Invalid username/password");
- return false;
+ throw new LoginException();
}
}
}
More information about the jboss-cvs-commits
mailing list