I am attempting to register a web hook to my Jira cloud instance and I am following their documentation but I have not been able to make it work.
Specifically the section: Making API requests to the product as the add-on
:
atlassianHostRestClients.authenticatedAsAddon(AddonAuthenticationType.OAUTH2).getForObject("/rest/api/example", Void.class);
My issue is when I run it I get an error:
401 Unauthorized: "{"message":"Client must be authenticated to access this >resource.","status-code":401}"
Now, I know I am not authenticated, but atlassianHostRestClients
object, which according to their documentation:
atlassian-connect-spring-boot will automatically sign requests from your add-on to an >installed host product with JSON Web Tokens. To make a request, just autowire an > AtlassianHostRestClients object into your class.
So, anyone has experience with this that could help?