improve authentication api for issue '#3 Add extension point for plugins to define groups and their members'

This commit is contained in:
Sebastian Sdorra
2011-01-08 13:04:04 +01:00
parent 5f29c02ce6
commit 37a9c506d9
6 changed files with 114 additions and 27 deletions

View File

@@ -97,11 +97,10 @@ public class ChainAuthenticatonManager extends AbstractAuthenticationManager
* @return
*/
@Override
public User authenticate(HttpServletRequest request,
HttpServletResponse response, String username,
String password)
public AuthenticationResult authenticate(HttpServletRequest request,
HttpServletResponse response, String username, String password)
{
User user = null;
AuthenticationResult ar = null;
for (AuthenticationHandler authenticator : authenticationHandlerSet)
{
@@ -122,8 +121,10 @@ public class ChainAuthenticatonManager extends AbstractAuthenticationManager
{
if (result.getState().isSuccessfully() && (result.getUser() != null))
{
user = result.getUser();
User user = result.getUser();
user.setType(authenticator.getType());
ar = result;
// notify authentication listeners
fireAuthenticationEvent(request, response, user);
@@ -138,7 +139,7 @@ public class ChainAuthenticatonManager extends AbstractAuthenticationManager
}
}
return user;
return ar;
}
/**