I encountered a problem in the project.The project framework is Atlassian Connect for Spring Boot .I wanted to call the rest api in the scheduled task,but found that I could not get the AtlassianHoustUser. How can I solve this problem?
String userContent = atlassianHostRestClients.authenticatedAs(hostUser).getForObject("/rest/api/user/current",String.class);
Does your Atlassian-connect.json have the READ scope / permission specified?
Yes, but the rest api cannot be called in the quartz scheduler
@liumulin from a scheduled job, you won’t have an authenticated SecurityContext, so you need to provide the host or host user yourself.
SecurityContext
See AtlassianHostUser#builder(AtlassianHost) for the latter.
AtlassianHostUser#builder(AtlassianHost)
I see. I have solved it now. Thank you.