hi jimmy

i am not sure it's possible to directly create tokens with jackrabbit upon user 
creation... the default way is to trigger token creation upon regular login by 
passing a empty token attribute along with the SimpleCredentials. subsequent 
logins would then be performed with TokenCredentials (see Jackrabbit API).

as far as user creation is concerned, i would recommend to use the Jackrabbit 
API. in other words:
JackrabbitSession.getUserManager() -> UserManager.createUser.

kind regards
angela

________________________________________
From: jimy page <[email protected]>
Sent: Friday, June 14, 2019 8:28 AM
To: [email protected]
Subject: Re: Enable token based login / authentication in jackrabbit 2.19/18

Thanks Angela for your reply.


I have few questions.

1. While creating users through userManagers this is what I am using:
config = RepositoryConfig.install(new File("/Users/xxx/jackrabbit/"));

after that we do repository.login().
Now there are 3 variants of repository.login() none of which takes token,
it takes New Credentials(username, password).

So here is my question:
1. While creating users, how do I create tokens as well ?
2. How do clients call repository.login() methods, passing token.

PS. I am unable to login to webdav url:

Repository repository = JcrUtils.getRepository("http://localhost:8090/server";);

This always gives error. where in through browser I can access repository.

What is the best practice to create users,

a> RepositoryConfig.install

b>or
JcrUtils.getRepository("http://localhost:8090/server";

the second one does not seem to be working for me.

Thanks

Jimmy




On Thu, Jun 13, 2019 at 8:06 PM Angela Schreiber <[email protected]>
wrote:

> hi
>
> as far as i remember it's enabled by default in jackrabbit 2.x (in
> contrast to jackrabbit oak where token authentication is handled by a
> separate loginmodule implementation). in other words: if i am not mistaken
> it should work out of the box with
> org.apache.jackrabbit.core.security.authentication.DefaultLoginModule. upon
> the first default login you have to make sure a token is created (empty
> token attribute) such that subsequent logins can use TokenCredentials with
> the token created.
>
> you may also consult
> org.apache.jackrabbit.core.security.authentication.token.TokenBasedAuthentication
> for further details.
>
> in general i would recommend using Apache Jackrabbit Oak, which is the
> successor of the Apache Jackrabbit
>
> hope that helps
> angela
> ________________________________________
> From: jimy page <[email protected]>
> Sent: Thursday, June 13, 2019 10:26 AM
> To: [email protected]
> Subject: Enable token based login / authentication in jackrabbit 2.19/18
>
> Dear Jackrabbit team
>
> I need to implement token based authentication on my jackrabbit server.
> Could you please guide me how do I do it ? I have not been able to find
> enough documentation / example to enable token based authentication.
>
> Some guidance/ sample code will be great help.
>
>
> Thanks
> Jimmy
>

Reply via email to