1

我一直在将 logincontext 对象作为凭据传递,以获取像这样的存储库登录会话

Repository repo = new Jcr(new Oak()).createRepository();
    final LoginContext lc= JaasAuthenticationTest.getlogincontext(); 
    Credentials credentials = new Credentials() {
        public LoginContext getLoginContext() { return lc; }
        };
Session session = repo.login(credentials);

和 JaasAuthenticationTest 看起来像

    lc = new LoginContext("nikhil", new TestCallbackHandler(name, password));
    return lc;

但显示错误:

javax.jcr.LoginException: Login Failure: all modules ignored
at org.apache.jackrabbit.oak.jcr.repository.RepositoryImpl.login(RepositoryImpl.java:262)
at org.apache.jackrabbit.oak.jcr.repository.RepositoryImpl.login(RepositoryImpl.java:220)
4

1 回答 1

2

你有没有尝试过:

session = repository.login(new SimpleCredentials("username", "password".toCharArray()));
于 2016-06-30T06:55:53.947 回答