Connect App JWT token use in Oauth Rest API calls

Hello,

I’m trying to use JWT from Connect app to get the Access token to make Jira API calls, im not able to get the token,

curl -X POST
auth.atlassian.io/oauth2/token
-H ‘Accept: application/json’
-H ‘Accept-Encoding: gzip, deflate’
-H ‘Content-Type: application/x-www-form-urlencoded’
-H ‘Host: auth.atlassian.io
-H ‘User-Agent: PostmanRuntime/7.20.1’
-H ‘cache-control: no-cache’
-H ‘grant_type: urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=************’

I created the token manually , im following this(user-impersonation-for-connect-apps) to make the call. im getting this error

{
“error”: “invalid_request”,
“error_description”: “Required request body is missing: public java.util.concurrent.CompletableFuture<com.atlassian.oauth2.resource.AccessTokenResponse> com.atlassian.oauth2.resource.AuthorizationResource.requestToken(org.springframework.util.MultiValueMap<java.lang.String, java.lang.String>,org.springframework.web.context.request.WebRequest,javax.servlet.http.HttpServletResponse)”
}

if possible please provide a working approach.

Thanks in advance

Hi @Arun1,

grant_type is not a header. In step 3 of https://developer.atlassian.com/cloud/jira/platform/user-impersonation-for-connect-apps/ the last line (line 6) is the request body.

Please send that line as your request body, and let me know if that fixes your issue.

thanks, that worked for me