|
|
|
@ -1,4 +1,4 @@ |
|
|
|
/* Copyright 2004 Acegi Technology Pty Limited |
|
|
|
/* Copyright 2004, 2005 Acegi Technology Pty Limited |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -15,11 +15,11 @@ |
|
|
|
|
|
|
|
|
|
|
|
package net.sf.acegisecurity.adapters.jboss; |
|
|
|
package net.sf.acegisecurity.adapters.jboss; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import net.sf.acegisecurity.AccountExpiredException; |
|
|
|
import net.sf.acegisecurity.Authentication; |
|
|
|
import net.sf.acegisecurity.Authentication; |
|
|
|
import net.sf.acegisecurity.AuthenticationException; |
|
|
|
import net.sf.acegisecurity.AuthenticationException; |
|
|
|
import net.sf.acegisecurity.CredentialsExpiredException; |
|
|
|
|
|
|
|
import net.sf.acegisecurity.AccountExpiredException; |
|
|
|
|
|
|
|
import net.sf.acegisecurity.AuthenticationManager; |
|
|
|
import net.sf.acegisecurity.AuthenticationManager; |
|
|
|
|
|
|
|
import net.sf.acegisecurity.CredentialsExpiredException; |
|
|
|
import net.sf.acegisecurity.adapters.PrincipalAcegiUserToken; |
|
|
|
import net.sf.acegisecurity.adapters.PrincipalAcegiUserToken; |
|
|
|
import net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken; |
|
|
|
import net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken; |
|
|
|
|
|
|
|
|
|
|
|
@ -58,7 +58,7 @@ import javax.security.auth.login.LoginException; |
|
|
|
* </p> |
|
|
|
* </p> |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Ben Alex |
|
|
|
* @author Ben Alex |
|
|
|
* @author Sergio Berná |
|
|
|
* @author Sergio Bern<EFBFBD> |
|
|
|
* @version $Id$ |
|
|
|
* @version $Id$ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class JbossAcegiLoginModule extends AbstractServerLoginModule { |
|
|
|
public class JbossAcegiLoginModule extends AbstractServerLoginModule { |
|
|
|
@ -216,12 +216,17 @@ public class JbossAcegiLoginModule extends AbstractServerLoginModule { |
|
|
|
if (super.log.isDebugEnabled()) { |
|
|
|
if (super.log.isDebugEnabled()) { |
|
|
|
super.log.debug("Credential has expired"); |
|
|
|
super.log.debug("Credential has expired"); |
|
|
|
} |
|
|
|
} |
|
|
|
throw new javax.security.auth.login.CredentialExpiredException("The credential used to identify the user has expired"); |
|
|
|
|
|
|
|
|
|
|
|
throw new javax.security.auth.login.CredentialExpiredException( |
|
|
|
|
|
|
|
"The credential used to identify the user has expired"); |
|
|
|
} catch (AccountExpiredException cee) { |
|
|
|
} catch (AccountExpiredException cee) { |
|
|
|
if (super.log.isDebugEnabled()) { |
|
|
|
if (super.log.isDebugEnabled()) { |
|
|
|
super.log.debug("Account has expired, throwing jaas exception"); |
|
|
|
super.log.debug( |
|
|
|
|
|
|
|
"Account has expired, throwing jaas exception"); |
|
|
|
} |
|
|
|
} |
|
|
|
throw new javax.security.auth.login.AccountExpiredException("The account specified in login has expired"); |
|
|
|
|
|
|
|
|
|
|
|
throw new javax.security.auth.login.AccountExpiredException( |
|
|
|
|
|
|
|
"The account specified in login has expired"); |
|
|
|
} catch (AuthenticationException failed) { |
|
|
|
} catch (AuthenticationException failed) { |
|
|
|
if (super.log.isDebugEnabled()) { |
|
|
|
if (super.log.isDebugEnabled()) { |
|
|
|
super.log.debug("Bad password for username=" + username); |
|
|
|
super.log.debug("Bad password for username=" + username); |
|
|
|
|