Package org.springframework.security.authentication

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


    @Test
    public void testSuccessfulAuthentication() {
        String[] grants = {"tester", "insight"};
        Authentication token = new TestingAuthenticationToken("testSuccessfulAuthentication", "shir", grants);
        AuthenticationProvider testProvider = new AuthenticationProviderCollectionAspectTestProvider(false);
        Authentication result = testProvider.authenticate(token);
        assertNotNull("No authentication result", result);
        assertSame("Mismatched authentication instances equality", token, result);
        assertOperationResult(result, Arrays.asList(grants));
    }
View Full Code Here


        getAspect().setSensitiveValueMarker(marker);

        String[] grants = {"tester", "insight"};
        Authentication token = new TestingAuthenticationToken("testObscuredCredentials", "omer", grants);
        AuthenticationProvider testProvider = new AuthenticationProviderCollectionAspectTestProvider(true);
        Authentication result = testProvider.authenticate(token);
        assertNotSame("Authentication token not cloned", token, result);
        assertObscuredAuthValues(token, result, marker);
    }

    @Override
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.