Plugin Agent/Sever Communication - Unidirectional
Answered
We have a custom plugin which we previously configured using XML-RPC which we now want to switch to unidirectional. The problem with this is that the agent requires some details from the server (server-side plugin) to authenticate with an downstream app which currently gets sent via XML-RPC from server to agent.
Is there a way for the server to allow registered agents to request these details?
Please sign in to leave a comment.
Hi, you can register custom a controller (https://confluence.jetbrains.com/display/TCD10/Web+UI+Extensions#WebUIExtensions-DevelopingaCustomController) that will provide the necessary data by HTTP. Then call the controller from the agent.
We've already got a controller configured. How do you call it from agent side though?
Just send ordinary http requests using HttpClient instance obtained from the HttpUtil class.
I am getting error with 401 http status code. I added the my code below. I require credentials which I don't know how to obtain. Do you have any idea. By the way thank your for support.
You are getting 401 response because the Controller requires authorization.
If the Controller doesn't provide any secured data then you can omit the authentication using the following method:
Another way is to add some user credentials to the request, it depends on the controller logic. Could you share what is the controller responsible for?
Thank you for your response.
Controller will store scanresult data for viewlogtab by storing data to customdatastore. How can i find userid and password for basic form authentication.
//code form my controller.
//code from DataStorage
Hi,
you can create a special user with administration permissions for the build configuration and use his credentials for the Basic authentication. But please note that in this case credentials can be become publicly visible.