How to use TokenAuthInterceptor in Nuxeo Java Client ?

Hello,

I am looking for code samples or examples of using TokenAuthInterceptor instead of BasicAuthInterceptor.

NuxeoClient nuxeoClient = new NuxeoClient.Builder()
                                         .url(url)
                                         .authentication("Administrator", "Administrator")
                                         .connect();

Thank you.

0 votes

2 answers

87 views

ANSWER



Hello,

Documentation about authentication can be found there. Here below an example:

NuxeoClient nuxeoClient = new NuxeoClient.Builder()
                                         .url(url)
                                         .authentication(new TokenAuthInterceptor("YOUR_TOKEN"))
                                         .connect();

Note: We're currently working on improving this documentation.

1 votes



Do you have more details in how to build the token (the format, the hash function) ?

How the token will be interpreted by the Nuxeo Client ?

Thank you!

0 votes



Nuxeo Java Client doesn't handle handshake phase. You first need to acquire a token by following this documentation, then you can give the generated token to client using TokenAuthInterceptor.

The handshake phase could be done with client by giving basic authentication and using basic http apis such as get method.

I created JAVACLIENT-174 to create an API to request this token.

11/19/2018