To test out the new debug settings, let’s debug the source code that is called when you call the remote API to get a ticket that can be used for authentication. For more information, seeAuthenticate with the Repository.
Open the alfresco-community-repo project in IntelliJ IDEA and look up the src/main/java/org/alfresco/rest/api/impl/AuthenticationsImpl.java file. Set a breakpoint in this file where a ticket is created, as shown:
Set up a Remote debugging session in IDEA (
):Click Debug to start the debug session:
Now, call the Remote API that is used to log in and get a ticket (using the default admin/admin credentials):
% curl --header "Content-Type: application/json" --request POST --data '{"userId":"admin","password":"admin"}' http://localhost:8080/alfresco/api/-default-/public/authentication/versions/1/tickets
This should make the debugger stop on the breakpoint line in IDEA:
We can see the credentials used to log in, and start debugging the code as we are used to.
This way of debugging works equally well for any custom code that you have applied to Content Services.