I am new using JackRabbit. I have one problem, I need add the username and password to access to the repository. At the moment, I can access whit every password and user but, for my need, it is not secure.
I have found jackrabbit-repo.xml file. but I don't know where I have to add these params. (in security>LoginModule or Filesystem or anywhere). please guide me by sample code if it is possible for you.
Update:
In jackrabbit-repository.xml has used simpleAccessManager and there was not any credentials for login. So I have changed it to DefaultSecurityManager and also add “adminId” param in LoginModule due to tell to Repository only adminUsers can login.
<SecurityManager class="org.apache.jackrabbit.core.DefaultSecurityManager"
workspaceName="security" />
<AccessManager class="org.apache.jackrabbit.core.security.DefaultAccessManager"/>
<LoginModule class="org.apache.jackrabbit.core.security.authentication.DefaultLoginModule">
<param name="adminId" value="admin"/>
</LoginModule>
Now, it works well unless anonymous user wants to login, in this case display error. and it is fine. But I have faced to a new error. when in application tries to access files in repository, it will faced a below error.
java.util.concurrent.ExecutionException: org.springframework.dao.DataAccessResourceFailureException: Could not open Jcr Session; nested exception is javax.jcr.LoginException: LoginModule ignored Credentials
Note: PersistenManager dataType is derby. Because repository is not database.
Thanks