Package org.springframework.security.authentication

Examples of org.springframework.security.authentication.RememberMeAuthenticationProvider.authenticate()


        RememberMeAuthenticationToken token = new RememberMeAuthenticationToken("WRONG_KEY", "Test",
                AuthorityUtils.createAuthorityList("ROLE_ONE", "ROLE_TWO"));

        try {
            aap.authenticate(token);
            fail("Should have thrown BadCredentialsException");
        } catch (BadCredentialsException expected) {
        }
    }
View Full Code Here


        TestingAuthenticationToken token = new TestingAuthenticationToken("user", "password","ROLE_A");
        assertFalse(aap.supports(TestingAuthenticationToken.class));

        // Try it anyway
        assertNull(aap.authenticate(token));
    }

    public void testNormalOperation() throws Exception {
        RememberMeAuthenticationProvider aap = new RememberMeAuthenticationProvider();
        aap.setKey("qwerty");
View Full Code Here

        aap.setKey("qwerty");

        RememberMeAuthenticationToken token = new RememberMeAuthenticationToken("qwerty", "Test",
                AuthorityUtils.createAuthorityList("ROLE_ONE", "ROLE_TWO"));

        Authentication result = aap.authenticate(token);

        assertEquals(result, token);
    }

    public void testSupports() {
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.