Package javax.security.auth.login

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


public class AccountLockedExceptionTest extends SerializationTest {

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

        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

        }
        // 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

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

    /**
     * @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

public class AccountLockedExceptionTest extends SerializationTest {

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

                    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

                throw new AccountNotFoundException("Not a user " + userId);
            }

            User user = (User) authorizable;
            if (user.isDisabled()) {
                throw new AccountLockedException("User with ID " + userId + " has been disabled: "+ user.getDisabledReason());
            }

            if (credentials instanceof SimpleCredentials) {
                SimpleCredentials creds = (SimpleCredentials) credentials;
                Credentials userCreds = user.getCredentials();
View Full Code Here

TOP

Related Classes of javax.security.auth.login.AccountLockedException

Copyright © 2018 www.massapicom. 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.