How do I generate a new "client configuration" on java code for the java out of process rest api ?

cancel
Showing results for 
Search instead for 
Did you mean: 
4535992
Senior Member

How do I generate a new "client configuration" on java code for the java out of process rest api ?

 I would like to use the user set in "application.properties" as the application user to generate individual user tickets using the rest api service "generateTicket".

To make a simple use case, I have an alfresco username/ClientConfiguration map "Map<String,ClientConfiguration>" and I want to invoke the rest api's "getNode" method with the user name XXX.

1) Retrieve the "ClientConfiguration" from the map with the specific key "XXX": tickets.get("XXX")

2) Prepare the component to use the service "nodesApi.getNode()" with the specific "ClientConfiguration"

My questions are:

1) How to create a client configuration runtime from java code ? The current client configuration is created with spring annotations that retrieve values from the "applications.properties" file.

2) Once I have solved step 1 ) and created the java object "ClientConfiguration" associated with a specific user "XXX" how do I use it to set the services (NodesApi, etc.) to use that user ?