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

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


            @Override
            public String getName() {
                return OakSlingRepository.this.adminName;
            }
        });
        AuthInfo authInfo = new AuthInfoImpl(this.adminName, Collections.<String, Object> emptyMap(), principals);
        Subject subject = new Subject(true, principals, singleton(authInfo), Collections.<Object> emptySet());
        Session adminSession;
        try {
            adminSession = Subject.doAsPrivileged(subject, new PrivilegedExceptionAction<Session>() {
                @Override
View Full Code Here


            final SecurityProvider securityProvider, final QueryIndexProvider indexProvider) {

        super(store, hook, workspaceName, SystemSubject.INSTANCE, securityProvider, indexProvider);

        contentSession = new ContentSession() {
            private final AuthInfoImpl authInfo = new AuthInfoImpl(
                    null, null, SystemSubject.INSTANCE.getPrincipals());

            @Override
            public void close() {
            }
View Full Code Here

            SimpleCredentials sc = (SimpleCredentials) creds;
            for (String attrName : sc.getAttributeNames()) {
                attributes.put(attrName, sc.getAttribute(attrName));
            }
        }
        return new AuthInfoImpl(userId, attributes, principals);
    }
View Full Code Here

            Map<String, String> publicAttributes = tokenInfo.getPublicAttributes();
            for (String attrName : publicAttributes.keySet()) {
                attributes.put(attrName, publicAttributes.get(attrName));
            }
        }
        return new AuthInfoImpl(userId, attributes, principals);
    }
View Full Code Here

            SimpleCredentials sc = (SimpleCredentials) credentials;
            for (String attrName : sc.getAttributeNames()) {
                attributes.put(attrName, sc.getAttribute(attrName));
            }
        }
        return new AuthInfoImpl(userId, attributes, principals);
    }
View Full Code Here

        super(store, hook, PostCommitHook.EMPTY, workspaceName,
                SystemSubject.INSTANCE, securityProvider, indexProvider);

        contentSession = new ContentSession() {
            private final AuthInfoImpl authInfo = new AuthInfoImpl(
                    null, null, SystemSubject.INSTANCE.getPrincipals());

            @Override
            public void close() {
            }
View Full Code Here

            SimpleCredentials sc = (SimpleCredentials) credentials;
            for (String attrName : sc.getAttributeNames()) {
                attributes.put(attrName, sc.getAttribute(attrName));
            }
        }
        return new AuthInfoImpl(userId, attributes, principals);
    }
View Full Code Here

        ContentSession cs = null;
        try {
            SimpleCredentials sc = (SimpleCredentials) getAdminCredentials();
            sc.setAttribute(".token", "");

            ImpersonationCredentials ic = new ImpersonationCredentials(sc, new AuthInfoImpl(((SimpleCredentials) getAdminCredentials()).getUserID(), Collections.<String, Object>emptyMap(), Collections.<Principal>emptySet()));
            cs = login(ic);

            Object token = sc.getAttribute(".token").toString();
            assertNotNull(token);
            TokenCredentials tc = new TokenCredentials(token.toString());
View Full Code Here

            SimpleCredentials sc = (SimpleCredentials) getAdminCredentials();
            sc.setAttribute(".token", "");
            sc.setAttribute(".token.mandatory", "something");
            sc.setAttribute("attr", "val");

            ImpersonationCredentials ic = new ImpersonationCredentials(sc, new AuthInfoImpl(((SimpleCredentials) getAdminCredentials()).getUserID(), Collections.<String, Object>emptyMap(), Collections.<Principal>emptySet()));
            cs = login(ic);

            AuthInfo ai = cs.getAuthInfo();
            Set<String> attrNames = ImmutableSet.copyOf(ai.getAttributeNames());
            assertTrue(attrNames.contains("attr"));
View Full Code Here

            Set<? extends Principal> principals = getPrincipals(externalUser.getId());
            if (!principals.isEmpty()) {
                if (!subject.isReadOnly()) {
                    subject.getPrincipals().addAll(principals);
                    subject.getPublicCredentials().add(credentials);
                    setAuthInfo(new AuthInfoImpl(externalUser.getId(), null, principals), subject);
                } else {
                    log.debug("Could not add information to read only subject {}", subject);
                }
                return true;
            }
View Full Code Here

TOP

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

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.