开发者

How do I prevent SimpleSecurityManager being used in JackRabbit?

开发者 https://www.devze.com 2023-03-17 20:58 出处:网络
How I stop Jackrabbit using SimpleSecurityManager? I\'m trying to call session.getUserManager() but I get a repository exception as SimpleSecurityManager.getUserManager() explicity throws it.

How I stop Jackrabbit using SimpleSecurityManager?

I'm trying to call session.getUserManager() but I get a repository exception as SimpleSecurityManager.getUserManager() explicity throws it.

<Security appName="Jackrabbit">
    <SecurityManager class="org.apache.jackrabbit.core.DefaultSecurityManager" workspaceName="security">
    </SecurityM开发者_高级运维anager>

    <AccessManager class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager">
        <!-- <param name="config" value="${rep.home}/access.xml"/> -->
    </AccessManager>

    <LoginModule class="org.apache.jackrabbit.core.security.authentication.DefaultLoginModule">
       <param name="anonymousId" value="anonymous"/>
       <param name="adminId" value="admin"/>
    </LoginModule>
</Security>

Rest of code for those that will ask...

Repository repository = new TransientRepository();
Session jackrabbitSession = repository.login(credentials);
UserManager userManager = session.getUserManager();


The user manager is a Jackrabbit extension. It's not a part of the JCR. So, you need to use a JackrabbitSession, not just a Session. Here's a link to the wiki:

http://wiki.apache.org/jackrabbit/UserManagement

0

精彩评论

暂无评论...
验证码 换一张
取 消