Examples of GuestCredentials


Examples of javax.jcr.GuestCredentials

    }

    @Test
    public void testCreateTokenFromInvalidCredentials() throws Exception {
        List<Credentials> invalid = new ArrayList<Credentials>();
        invalid.add(new GuestCredentials());
        invalid.add(new TokenCredentials("sometoken"));
        invalid.add(new ImpersonationCredentials(new GuestCredentials(), null));
        invalid.add(new SimpleCredentials("unknownUserId", new char[0]));

        for (Credentials creds : invalid) {
            assertNull(tokenProvider.createToken(creds));
        }
View Full Code Here

Examples of javax.jcr.GuestCredentials

        }

        // login as admin should fail
        ContentSession anonymousSession = null;
        try {
            anonymousSession = repo.login(new GuestCredentials(), null);
            fail();
        } catch (LoginException e) {
            //success
        } finally {
            if (anonymousSession != null) {
View Full Code Here

Examples of javax.jcr.GuestCredentials

    @Test
    public void testGuestLogin() throws Exception {
        ContentSession cs = null;
        try {
            cs = login(new GuestCredentials());
            fail("GuestCredentials login should fail");
        } catch (LoginException e) {
            // success
        } finally {
            if (cs != null) {
View Full Code Here

Examples of javax.jcr.GuestCredentials

        this.repository = repository;
        this.batchReadConfig = batchReadConfig;
        this.supportsObservation = "true".equals(repository.getDescriptor(Repository.OPTION_OBSERVATION_SUPPORTED));

        try {
            Session s = repository.login(new GuestCredentials());
            ValueFactory vf = s.getValueFactory();
            if (vf instanceof ValueFactoryQImpl) {
                qValueFactory = ((ValueFactoryQImpl) vf).getQValueFactory();
            }
        } catch (RepositoryException e) {
View Full Code Here

Examples of javax.jcr.GuestCredentials

        return repository;
    }

    @Override
    public Credentials getReadOnlyCredentials() {
        return new GuestCredentials();
    }
View Full Code Here

Examples of javax.jcr.GuestCredentials

    protected Session createAnonymousSession() throws RepositoryException {
        Session admin = getAdminSession();
        AccessControlUtils.addAccessControlEntry(admin, "/", EveryonePrincipal.getInstance(), new String[] {Privilege.JCR_READ}, true);
        admin.save();
        return getRepository().login(new GuestCredentials());
    }
View Full Code Here

Examples of javax.jcr.GuestCredentials

        return repository;
    }

    @Override
    public Credentials getReadOnlyCredentials() {
        return new GuestCredentials();
    }
View Full Code Here

Examples of javax.jcr.GuestCredentials

        }

        // login as admin should fail
        ContentSession anonymousSession = null;
        try {
            anonymousSession = repo.login(new GuestCredentials(), null);
            fail();
        } catch (LoginException e) {
            //success
        } finally {
            if (anonymousSession != null) {
View Full Code Here

Examples of javax.jcr.GuestCredentials

    }

    @Test
    public void testAuthenticateInvalidImpersonationCredentials() throws Exception {
       List<Credentials> invalid = new ArrayList<Credentials>();
        invalid.add(new ImpersonationCredentials(new GuestCredentials(), adminSession.getAuthInfo()));
        invalid.add(new ImpersonationCredentials(new SimpleCredentials(adminSession.getAuthInfo().getUserID(), new char[0]), new TestAuthInfo()));
        invalid.add(new ImpersonationCredentials(new SimpleCredentials("unknown", new char[0]), adminSession.getAuthInfo()));
        invalid.add(new ImpersonationCredentials(new SimpleCredentials("unknown", new char[0]), new TestAuthInfo()));

        for (Credentials creds : invalid) {
View Full Code Here

Examples of javax.jcr.GuestCredentials

        }
    }

    @Test
    public void testGuestLogin() throws Exception {
        ContentSession cs = login(new GuestCredentials());
        try {
            AuthInfo authInfo = cs.getAuthInfo();
            String anonymousID = UserUtil.getAnonymousId(getUserConfiguration().getParameters());
            assertEquals(anonymousID, authInfo.getUserID());
        } finally {
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.