JWT token required | HTTP Action | Workflow

Hi team,

This post is conceptually an extension to this(below link) post but creating this as this is a different topic: Create account API | Delimited source | multi valued attribute - #17 by vbdm

I am trying to add a HTTP Action step as part of the workflow.

The below postman call worked:

curl --location 'https://<demo_tenant>.com/v2025/accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <Token>' \
--data-raw '{
        "attributes": {
            "sourceId": "source_id",
            "empID": "466667",
            "userID": "hgd1g3",
            "email": [
                "[email protected]",
                "[email protected]",
                "[email protected]"
            ]
                
            
        }
}'

Here are some screen shots of me trying to replicate the same in UI(workflow)




I am testing this workflow with a test input data who has all the details and here is the HTTP action step input that fails:

{
  "authenticationType": "OAuth",
  "basicAuthPassword": null,
  "basicAuthUserName": null,
  "csvRequestBody": null,
  "formRequestBody": null,
  "headerAuthName": null,
  "headerAuthValue": null,
  "jsonRequestBody": {
    "attributes": {
      "email": [
        "[email protected]"
      ],
      "empID": "435465",
      "sourceId": "source_id",
      "userID": "skh6t4"
    }
  },
  "method": "post",
  "oAuthClientId": "client_id",
  "oAuthClientSecret": "$.secrets.abc-xyz",
  "oAuthCredentialLocation": "oAuthInHeader",
  "oAuthScope": null,
  "oAuthTokenUrl": "https://<demo_tenant>.com/oauth/token",
  "requestContentType": "json",
  "requestHeaders": {
    "Accept": "application/json",
    "Content-Type": "application/json"
  },
  "suppliedInlineExpression": {
    "jsonRequestBody": "{\"attributes\":{\"email\":[\"{{$.getIdentity.attributes.email}}\"],\"empID\":\"{{$.getIdentity.attributes.displayName}}\",\"sourceId\":\"source_id\",\"userID\":\"{{$.getIdentity.attributes.uid}}\"}}"
  },
  "textRequestBody": null,
  "url": "https://<demo_tenant>.com/v2025/accounts",
  "urlParams": null,
  "xmlRequestBody": null
}

and I get this error:

{"error":"task failed: activity error (type: sp:external:http:v2, scheduledEventID: 11, startedEventID: 12, identity: 1@sp-workflow-worker-internal-cbb8f7dc-7c75v@sp-workflow-engine): request failed (type: HTTP Response Returned a Client Error, retryable: false): request failed: 401 - 401 Unauthorized - {\"error\":\"JWT is required\"}"

I have seen this error before: so here is what I did:

  • Checked that client ID and secret are same and complete between postman and workflow
  • Deleted the sttp step and re-created the http step
  • Ensured that this PAT has all scope
  • The owner of the workflow is a admin

Any suggestions?

Hi Veera,

Could you please check if the TOKEN URL has api endpoint in the url? “POST https://[tenant].[api.identitynow.com/oauth/token]”(http://demo123.api.identitynow.com/oauth/token)

That did the trick.

Thank you @nithyamn13