Package org.jasig.cas.support.spnego

Examples of org.jasig.cas.support.spnego.MockJCSIFAuthentication


    }

    public void testSuccessfulAuthenticationWithDomainName() throws AuthenticationException {
        final SpnegoCredentials credentials = new SpnegoCredentials(new byte[] {0, 1, 2});
        this.authenticationHandler.setPrincipalWithDomainName(true);
        this.authenticationHandler.setAuthentication(new MockJCSIFAuthentication(true));
        assertTrue(this.authenticationHandler.authenticate(credentials));
        assertEquals("test", credentials.getPrincipal().getId());
        assertNotNull(credentials.getNextToken());
    }
View Full Code Here


    }

    public void testSuccessfulAuthenticationWithoutDomainName() throws AuthenticationException {
        final SpnegoCredentials credentials = new SpnegoCredentials(new byte[] {0, 1, 2});
        this.authenticationHandler.setPrincipalWithDomainName(false);
        this.authenticationHandler.setAuthentication(new MockJCSIFAuthentication(true));
        assertTrue(this.authenticationHandler.authenticate(credentials));
        assertEquals("test", credentials.getPrincipal().getId());
        assertNotNull(credentials.getNextToken());
    }
View Full Code Here

        assertNotNull(credentials.getNextToken());
    }

    public void testUnsuccessfulAuthentication() {
        final SpnegoCredentials credentials = new SpnegoCredentials(new byte[] {0, 1, 2});
        this.authenticationHandler.setAuthentication(new MockJCSIFAuthentication(false));
        try {
            this.authenticationHandler.authenticate(credentials);
            fail("An AuthenticationException should have been thrown");
        } catch (AuthenticationException e) {
            assertNull(credentials.getNextToken());
View Full Code Here

TOP

Related Classes of org.jasig.cas.support.spnego.MockJCSIFAuthentication

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.