jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: Authentication for Repository
Date Tue, 02 Dec 2008 14:11:50 GMT
Hi,

On Tue, Dec 2, 2008 at 11:43 AM, hosseinakbari <h_akbari@magfa.com> wrote:
> How can I put username and password for accessing a repository

The Repository.login method takes an optional Credentials argument.
You can use a SimpleCredentials instance with the username and
password as this argument:

    import javax.jcr.*;

    Credentials credentials = new SimpleCredentials(
        "username", "password".toCharArray());
    Session session = repository.login(credentials);

BR,

Jukka Zitting

Mime
View raw message