Package javax.naming

Examples of javax.naming.AuthenticationException


        {
            ne = new AttributeInUseException( t.getLocalizedMessage() );
        }
        else if ( t instanceof LdapAuthenticationException )
        {
            ne = new AuthenticationException( t.getLocalizedMessage() );
        }
        else if ( t instanceof LdapAuthenticationNotSupportedException )
        {
            ne = new AuthenticationNotSupportedException( t.getLocalizedMessage() );
        }
View Full Code Here


    static final String msg = "[LDAP: error code 49 - 80858585: LdapErr: DSID-DECAFF0, comment: AcceptSecurityContext error, data ";

    @Test(expected = BadCredentialsException.class)
    public void userNotFoundIsCorrectlyMapped() {
        provider.contextFactory = createContextFactoryThrowing(new AuthenticationException(msg + "525, xxxx]"));
        provider.setConvertSubErrorCodesToExceptions(true);
        provider.authenticate(joe);
    }
View Full Code Here

        provider.authenticate(joe);
    }

    @Test(expected = BadCredentialsException.class)
    public void incorrectPasswordIsCorrectlyMapped() {
        provider.contextFactory = createContextFactoryThrowing(new AuthenticationException(msg + "52e, xxxx]"));
        provider.setConvertSubErrorCodesToExceptions(true);
        provider.authenticate(joe);
    }
View Full Code Here

        provider.authenticate(joe);
    }

    @Test(expected = BadCredentialsException.class)
    public void notPermittedIsCorrectlyMapped() {
        provider.contextFactory = createContextFactoryThrowing(new AuthenticationException(msg + "530, xxxx]"));
        provider.setConvertSubErrorCodesToExceptions(true);
        provider.authenticate(joe);
    }
View Full Code Here

    }

    @Test
    public void passwordNeedsResetIsCorrectlyMapped() {
        final String dataCode = "773";
        provider.contextFactory = createContextFactoryThrowing(new AuthenticationException(msg + dataCode+", xxxx]"));
        provider.setConvertSubErrorCodesToExceptions(true);

        thrown.expect(BadCredentialsException.class);
        thrown.expect(new BaseMatcher<BadCredentialsException>() {
            private Matcher<Object> causeInstance = CoreMatchers.instanceOf(ActiveDirectoryAuthenticationException.class);
View Full Code Here

        provider.authenticate(joe);
    }

    @Test(expected = CredentialsExpiredException.class)
    public void expiredPasswordIsCorrectlyMapped() {
        provider.contextFactory = createContextFactoryThrowing(new AuthenticationException(msg + "532, xxxx]"));

        try {
            provider.authenticate(joe);
            fail();
        } catch (BadCredentialsException expected) {
View Full Code Here

        provider.authenticate(joe);
    }

    @Test(expected = DisabledException.class)
    public void accountDisabledIsCorrectlyMapped() {
        provider.contextFactory = createContextFactoryThrowing(new AuthenticationException(msg + "533, xxxx]"));
        provider.setConvertSubErrorCodesToExceptions(true);
        provider.authenticate(joe);
    }
View Full Code Here

        provider.authenticate(joe);
    }

    @Test(expected = AccountExpiredException.class)
    public void accountExpiredIsCorrectlyMapped() {
        provider.contextFactory = createContextFactoryThrowing(new AuthenticationException(msg + "701, xxxx]"));
        provider.setConvertSubErrorCodesToExceptions(true);
        provider.authenticate(joe);
    }
View Full Code Here

        provider.authenticate(joe);
    }

    @Test(expected = LockedException.class)
    public void accountLockedIsCorrectlyMapped() {
        provider.contextFactory = createContextFactoryThrowing(new AuthenticationException(msg + "775, xxxx]"));
        provider.setConvertSubErrorCodesToExceptions(true);
        provider.authenticate(joe);
    }
View Full Code Here

        provider.authenticate(joe);
    }

    @Test(expected = BadCredentialsException.class)
    public void unknownErrorCodeIsCorrectlyMapped() {
        provider.contextFactory = createContextFactoryThrowing(new AuthenticationException(msg + "999, xxxx]"));
        provider.setConvertSubErrorCodesToExceptions(true);
        provider.authenticate(joe);
    }
View Full Code Here

TOP

Related Classes of javax.naming.AuthenticationException

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.