CompletableFuture and atlassian-connect-spring-boot v2.3.3 and Spring Boot v2.6.6

After we upgraded our Jira plugin to use the latest Spring Boot (2.6.6) and latest ACSB (2.3.3) all Async calls using CompletableFuture made to Jira rest API returns 401 Unauthorized.

ERROR:

Caused by: org.springframework.web.client.HttpClientErrorException$Unauthorized: 401 Unauthorized: "<EOL><EOL><EOL><EOL><EOL><EOL><EOL><EOL><EOL><html><EOL><EOL><head><EOL>    <title>Unauthorized (401)</title><EOL>    <EOL><EOL><EOL><EOL><EOL><EOL><!--[if IE]><![endif]--><EOL><script type="text/javascript" ><EOL>    var contextPath = '';<EOL>    var DeferScripts = { deferState: 'disabled' };<EOL></script><EOL><script><EOL>window.WRM=window.WRM||{};window.WRM._unparsedData=window.WRM._unparsedData||{};window.WRM._unparsedErrors=window.WRM._unparsedErrors||{};<EOL>WRM._unparsedData["com.atlassian.plugins.atlassian-plugins-webresource-plugin:context-path.context-path"]="\"\"";<EOL>WRM._unparsedData["com.atlassian.plugins.atlassian-plugins-webresource-rest:curl.cross-origin-resources"]="false";<EOL>WRM._unparsedData["jira.webresources:feature-flags.feature-flag-data"]="{\"enabled-feature-keys\":[\"connect.no-applinks\",\"nps.survey.inline.dialog\",\"atlassian.aui.raphael.disabled\"],\"feature-flag-states\":{\"jira.feature.flag.board.issue.modal.labs\":true,\"com.atlassian.jira.plugins.mail.internal\":false,\"com.atlassian.jira.feature.flag.for.TestFeatureFlagResource\":false,\"jira.feature.rest.single.step.avatar.upload\":true,\"jira.ondemand.maintain.trusted.apps\":true}}";<EOL>WRM._unparsedData["com.atlassian.jira.jira-client-analytics-plugin:analytics-context-provider.client-analytic-descriptors"]="{\"analyticsResource\":{\"jira-core\":{\"events\":{\"issue.comment.added\":{\"trigger\":\"click #issue-comment-add-submit\",\"properties\":{\"comment-length\":\"value.length #issue-comment-add #comment\"}}}}},\"tenantId\":\"25f9fe20-a132-4b38-acfa-e50f0031f18f\",\"env\":\"prod\"}";<EOL>WRM._unparsedData["jira.webresources:default-comment-security-level.DefaultCommentSecurityLevelHelpLink"]="{\"extraClasses\":\"default-comment-level-help\",\"title\":\"Commenting on an Issue\",\"url\":\"https://confluence.atlassian.com/display/JIRACORECLOUD/Editing+and+collaborating+on+issues#Editingandcollaboratingonissues-addcommentsCommentingonissues\",\"isLocal\":false}";<EOL>WRM

This issue posted here CompletableFuture and atlassian-connect-spring-boot is similar to what I am facing.

Please, has anyone experienced this issue and how can we solve it.

Thanks in advance,
Onuche

Dear @OnucheIdoko1

in our apps we did not discover any issue during the upgrade.

Which method are you using to authenticate?

If you use authenticatedAsHostActor from AtlassianHostRestClients I assume you must ensure that the security context is properly set in the function you trigger from supplyAsync or similar.

If you use authenticatedAsAddon or authenticatedAs you don’t have to set the security context. We only use those two functions and did not discover any issue.

I hope that helps.

Andreas

I am using authenticatedAsAddon() and authenticatedAs(AtlassianHostUser hostUser).

Our app was working properly before the upgrade.

Regards,
Onuche