Examples of RememberMeAuthenticationToken


Examples of org.springframework.security.authentication.RememberMeAuthenticationToken

    public void testDetectsAnInvalidKey() throws Exception {
        RememberMeAuthenticationProvider aap = new RememberMeAuthenticationProvider();
        aap.setKey("qwerty");

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

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

Examples of org.springframework.security.authentication.RememberMeAuthenticationToken

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

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

        Authentication result = aap.authenticate(token);

        assertEquals(result, token);
View Full Code Here

Examples of org.springframework.security.authentication.RememberMeAuthenticationToken

    }

    public void testCorrectOperationIsRememberMe() {
        AuthenticationTrustResolverImpl trustResolver = new AuthenticationTrustResolverImpl();
        assertTrue(trustResolver.isRememberMe(
                new RememberMeAuthenticationToken("ignored", "ignored", AuthorityUtils.createAuthorityList("ignored"))));
        assertFalse(trustResolver.isAnonymous(
                new TestingAuthenticationToken("ignored", "ignored", AuthorityUtils.createAuthorityList("ignored"))));
    }
View Full Code Here

Examples of org.springframework.security.authentication.RememberMeAuthenticationToken

    private Authentication createFullyAuthenticated() {
        return new UsernamePasswordAuthenticationToken("ignored", "ignored", AuthorityUtils.createAuthorityList("ignored"));
    }

    private Authentication createRememberMe() {
        return new RememberMeAuthenticationToken("ignored", "ignored", AuthorityUtils.createAuthorityList("ignored"));
    }
View Full Code Here

Examples of org.springframework.security.authentication.RememberMeAuthenticationToken

     *                      stored as the principal.
     *
     * @return the <tt>Authentication</tt> for the remember-me authenticated user
     */
    protected Authentication createSuccessfulAuthentication(HttpServletRequest request, UserDetails user) {
        RememberMeAuthenticationToken auth = new RememberMeAuthenticationToken(key, user, user.getAuthorities());
        auth.setDetails(authenticationDetailsSource.buildDetails(request));
        return auth;
    }
View Full Code Here

Examples of org.springframework.security.authentication.RememberMeAuthenticationToken

     *                      stored as the principal.
     *
     * @return the <tt>Authentication</tt> for the remember-me authenticated user
     */
    protected Authentication createSuccessfulAuthentication(HttpServletRequest request, UserDetails user) {
        RememberMeAuthenticationToken auth = new RememberMeAuthenticationToken(key, user, user.getAuthorities());
        auth.setDetails(authenticationDetailsSource.buildDetails(request));
        return auth;
    }
View Full Code Here

Examples of org.springframework.security.authentication.RememberMeAuthenticationToken

        } else {
            roles = new HashSet<GrantedAuthority>();
            roles.addAll(user.getAuthorities());
            roles.add(GeoServerRole.AUTHENTICATED_ROLE);
        }       
        RememberMeAuthenticationToken auth = new RememberMeAuthenticationToken(getKey(), user, roles);
        auth.setDetails(getAuthenticationDetailsSource().buildDetails(request));
        return auth;
    }
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.