Package org.geoserver.security

Examples of org.geoserver.security.GeoServerAuthenticationProvider.authenticate()


        UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken("sa","");
        token.setDetails("details");
        assertTrue(provider.supports(token.getClass()));
        assertTrue(!provider.supports(RememberMeAuthenticationToken.class));
       
        Authentication auth = provider.authenticate(token);
        assertNotNull(auth);
        assertEquals("sa", auth.getPrincipal());
        assertNull(auth.getCredentials());
       
        assertEquals("details", auth.getDetails());
View Full Code Here


        checkForAuthenticatedRole(auth);
       
        token = new UsernamePasswordAuthenticationToken("abc","def");
        boolean fail = false;
        try {
            if (provider.authenticate(token)==null)
                fail = true;
        } catch (BadCredentialsException ex) {
            fail=true;
        }       
        assertTrue(fail);
View Full Code Here

        UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken("sa","");
        token.setDetails("details");
        assertTrue(provider.supports(token.getClass()));
        assertFalse(provider.supports(RememberMeAuthenticationToken.class));
       
        Authentication auth = provider.authenticate(token);
        assertNotNull(auth);
        assertEquals("sa", auth.getPrincipal());
        assertNull(auth.getCredentials());
        assertEquals("details", auth.getDetails());
        assertEquals(2, auth.getAuthorities().size());
View Full Code Here

        ugStore =  ugService.createStore();
        sa.setEnabled(false);
        ugStore.updateUser(sa);
        ugStore.store();
       
        assertNull(provider.authenticate(token));
       
        // test invalid user
        token = new UsernamePasswordAuthenticationToken("abc","def");
        boolean fail = false;
        try {
View Full Code Here

       
        // test invalid user
        token = new UsernamePasswordAuthenticationToken("abc","def");
        boolean fail = false;
        try {
            if (provider.authenticate(token)==null)
                fail = true;
        } catch (BadCredentialsException ex) {
            fail=true;
        } catch (UsernameNotFoundException ex) {
            fail=true;
View Full Code Here

        UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken("sa","");
        token.setDetails("details");
        assertTrue(provider.supports(token.getClass()));
        assertFalse(provider.supports(RememberMeAuthenticationToken.class));
       
        Authentication auth = provider.authenticate(token);
        assertNotNull(auth);
        assertEquals("sa", auth.getPrincipal());
        assertNull(auth.getCredentials());
        assertEquals("details", auth.getDetails());
        assertEquals(2, auth.getAuthorities().size());
View Full Code Here

       
        // test invalid user
        token = new UsernamePasswordAuthenticationToken("abc","def");
        boolean fail = false;
        try {
            if (provider.authenticate(token)==null)
                fail=true;
        } catch (BadCredentialsException ex) {
            fail=true;
        } catch (UsernameNotFoundException ex) {
            fail=true;
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.