我一直在将 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)