Package org.apache.jackrabbit.oak.spi.security.authentication

Examples of org.apache.jackrabbit.oak.spi.security.authentication.Authentication


        userId = getTestUser().getID();
    }

    @Test
    public void testAuthenticateWithoutTokenProvider() throws Exception {
        Authentication authentication = new TokenAuthentication(null);

        assertFalse(authentication.authenticate(new TokenCredentials("token")));
    }
View Full Code Here


    }

    @Test
    public void testAuthenticateCannotResolveUser() throws Exception {
        SimpleCredentials sc = new SimpleCredentials("unknownUser", "pw".toCharArray());
        Authentication a = new UserAuthentication(sc.getUserID(), getUserManager(root));

        assertFalse(a.authenticate(sc));
    }
View Full Code Here

    @Test
    public void testAuthenticateResolvesToGroup() throws Exception {
        Group g = getUserManager(root).createGroup("g1");
        SimpleCredentials sc = new SimpleCredentials(g.getID(), "pw".toCharArray());
        Authentication a = new UserAuthentication(sc.getUserID(), getUserManager(root));

        try {
            a.authenticate(sc);
            fail("Authenticating Group should fail");
        } catch (LoginException e) {
            // success
        } finally {
            if (g != null) {
View Full Code Here

        if (credentials == null || userId == null) {
            log.debug("Could not extract userId/credentials");
            return false;
        }

        Authentication authentication = new UserAuthentication(userId, getUserManager());
        boolean success = authentication.authenticate(credentials);
        if (success) {
            principals = getPrincipals(userId);

            log.debug("Adding Credentials to shared state.");
            sharedState.put(SHARED_KEY_CREDENTIALS, credentials);
View Full Code Here

        if (credentials == null || userId == null) {
            log.debug("Could not extract userId/credentials");
            return false;
        }

        Authentication authentication = new UserAuthentication(userId, getUserManager());
        boolean success = authentication.authenticate(credentials);
        if (success) {
            principals = getPrincipals(userId);

            log.debug("Adding Credentials to shared state.");
            sharedState.put(SHARED_KEY_CREDENTIALS, credentials);
View Full Code Here

        super.before();
        authentication = new TokenAuthentication(tokenProvider);
    }
    @Test
    public void testAuthenticateWithoutTokenProvider() throws Exception {
        Authentication authentication = new TokenAuthentication(null);

        assertFalse(authentication.authenticate(new TokenCredentials("token")));
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.spi.security.authentication.Authentication

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.