0
votes

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

1
did you take a look at the manual? rabbitmq.com/access-control.htmlfateddy
@fateddy no I did not see it. are you sure it is related to jackrabbit?Omid Nazifi
whoops.. my bad. I was sure it read "rabbitmq". Sorry.fateddy

1 Answers

0
votes

The mentioned error means if the user exists in the 3rd party system but the credentials don’t match it throws LoginException.

java.util.concurrent.ExecutionException: org.springframework.dao.DataAccessResourceFailureException: Could not open Jcr Session; nested exception is javax.jcr.LoginException: LoginModule ignored Credentials

JAAS Authentication and Login Modules

Don't need to change something in PersistenManager or something else in workspace.