Examples of AccountLockedException


Examples of com.adito.security.AccountLockedException

                throw new InvalidLoginCredentialsException();
              }
             
              // Check the account is enabled and not locked
              if(!PolicyUtil.isEnabled(scheme.getUser())) {
                throw new AccountLockedException(scheme.getUsername(), "Account disabled.", true, 0);
              }
             
              // Check for locks
              LogonControllerFactory.getInstance().checkForAccountLock(scheme.getUsername(), scheme.getUser().getRealm().getResourceName());
View Full Code Here

Examples of com.adito.security.AccountLockedException

        try {
            if (!canLogin(user)) {
                throw new InvalidLoginCredentialsException("You do not have permission to logon.");
            }
            if (!isEnabled(user)) {
                throw new AccountLockedException(user.getPrincipalName(), "Account locked. Please contact your administrator.",
                                true, 0);
            }
        } catch (InvalidLoginCredentialsException lce) {
            throw lce;
        } catch (AccountLockedException ale) {
View Full Code Here

Examples of javax.security.auth.login.AccountLockedException

    /**
     * @tests javax.security.auth.login.AccountLockedException#AccountLockedException(
     *        java.lang.String)
     */
    public final void testCtor2() {
        assertNull(new AccountLockedException(null).getMessage());

        String message = "";
        assertSame(message, new AccountLockedException(message).getMessage());

        message = "message";
        assertSame(message, new AccountLockedException(message).getMessage());
    }
View Full Code Here

Examples of javax.security.auth.login.AccountLockedException

public class AccountLockedExceptionTest extends SerializationTest {

    @Override
    protected Object[] getData() {
        return new Object[] {new AccountLockedException("message")};
    }
View Full Code Here

Examples of javax.security.auth.login.AccountLockedException

        String[] grpList = realm.authenticateUser(_username, _password);

        if (grpList == null) {  // JAAS behavior
            throw new FailedLoginException("PHRRealm : Login Failed/Inactive with user " + _username);
        } else if (grpList.length > 0 && grpList[0].equalsIgnoreCase(realm.getLockedRole())) {
            throw new AccountLockedException("PHRRealm : Login Locked for user " + _username);
        }

        log("login succeeded for  " + _username);

        // Add the code related to authenticating to your user database.
View Full Code Here

Examples of javax.security.auth.login.AccountLockedException

        }
        // blocked! (note here the \" in blocked is deliberately missing for emailUser()
        if (line.contains("error code=\"blocked") || line.contains("error code=\"autoblocked\""))
        {
            log(Level.SEVERE, caller, "Cannot " + caller + " - user is blocked!.");
            throw new AccountLockedException("Current user is blocked!");
        }
        // database lock (automatic retry)
        if (line.contains("error code=\"readonly\""))
        {
            log(Level.WARNING, caller, "Database locked!");
View Full Code Here

Examples of javax.security.auth.login.AccountLockedException

    /**
     * @tests javax.security.auth.login.AccountLockedException#AccountLockedException()
     */
    public final void testCtor1() {
        assertNull(new AccountLockedException().getMessage());
    }
View Full Code Here

Examples of javax.security.auth.login.AccountLockedException

    /**
     * @tests javax.security.auth.login.AccountLockedException#AccountLockedException(
     *        java.lang.String)
     */
    public final void testCtor2() {
        assertNull(new AccountLockedException(null).getMessage());

        String message = "";
        assertSame(message, new AccountLockedException(message).getMessage());

        message = "message";
        assertSame(message, new AccountLockedException(message).getMessage());
    }
View Full Code Here

Examples of javax.security.auth.login.AccountLockedException

public class AccountLockedExceptionTest extends SerializationTest {

    @Override
    protected Object[] getData() {
        return new Object[] {new AccountLockedException("message")};
    }
View Full Code Here

Examples of javax.security.auth.login.AccountLockedException

                    failureText = saslClient.getMechanismName() + " authentication failed.";
                }
                if (authenticationFailure.getCondition() instanceof Failure.NotAuthorized) {
                    throw new FailedLoginException(failureText);
                } else if (authenticationFailure.getCondition() instanceof Failure.AccountDisabled) {
                    throw new AccountLockedException(failureText);
                } else if (authenticationFailure.getCondition() instanceof Failure.CredentialsExpired) {
                    throw new CredentialExpiredException(failureText);
                } else {
                    throw new LoginException(saslClient.getMechanismName() + " authentication failed with condition: " + (authenticationFailure.getCondition() != null ? authenticationFailure.getCondition().getClass().getSimpleName() : "unknown"));
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.