# Workflow HTTP Operation 401 JWT Required

**URL:** <https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323>\
**Category:** SHF Discussion and Questions\
**Tags:** workflows, sailpoint-identity-security\
**Created:** [May 20, 2024, 4:17pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323 "2024-05-20T16:17:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dominick-miller](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/dominick-miller/32/29002_2.png) [@dominick-miller](https://developer.sailpoint.com/discuss/u/dominick-miller)\
**Post date:** [May 20, 2024, 4:17pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323/1 "2024-05-20T16:17:48Z")

</div>

Hi all,

I have a scheduled workflow that I am currently triggering manually for testing. It is a simple Workflow that will hit only one ISC endpoint via an HTTP Operation action. What I’m running into right now is an HTTP 401 “JWT is required” error. I have my one HTTP Operation configured to use OAuth2 client credentials grant flow. My token URL is: https://.api.identitynow.com/oauth/token, my clientId and clientSecret are validated to work via Postman. My credential location is header, my scope is blank, my request headers are “Accept”: “application/json”.

Is there any additional configuration needed for this? I thought the bearer token would get generated and passed after hitting the OAuth endpoint into my request headers automatically. Do I need to reference the token or prep the headers with “Authentication”: “Bearer” or anything like this?

Also worth noting is I have tried setting my token URL to https://.api.identitynow.com/oauth/token?grant\_type=client\_credentials and this also did not work.

---

<div class="post-metadata">

**Author:** ![ipobeidi](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/ipobeidi/32/16000_2.png) [@ipobeidi](https://developer.sailpoint.com/discuss/u/ipobeidi)\
**Post date:** [May 20, 2024, 4:22pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323/2 "2024-05-20T16:22:28Z")

</div>

Hey !

Make sure the user actually have the accffess to do the operation/requested URL.  
Can you attache the workflow for us to see and help you?

Best!

---

<div class="post-metadata">

**Author:** ![dominick-miller](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/dominick-miller/32/29002_2.png) [@dominick-miller](https://developer.sailpoint.com/discuss/u/dominick-miller)\
**Post date:** [May 20, 2024, 4:28pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323/3 "2024-05-20T16:28:34Z")

</div>

Hi Ivan,

Please see the bit above where I have validated the clientId and clientSecret. I have pasted a stripped down version of the workflow code below. I basically am just looking to see if I need to be doing anything special or if the OAuth client credentials flow should be handling the authentication for my HTTP request automatically. If so, then this is likely a bug.

```auto
{
    "id": "<id>",
    "name": "test wf",
    "description": "",
    "definition": {
        "start": "HTTP Request",
        "steps": {
            "End Step - Success": {
                "displayName": "",
                "type": "success"
            },
            "HTTP Request": {
                "actionId": "sp:http",
                "attributes": {
                    "authenticationType": "OAuth",
                    "method": "get",
                    "oAuthClientId": "<validClientId>",
                    "oAuthClientSecret": "<validClientSecret>",
                    "oAuthCredentialLocation": "oAuthInHeader",
                    "oAuthScope": null,
                    "oAuthTokenUrl": "https://<tenant>.api.identitynow.com/oauth/token",
                    "requestContentType": "json",
                    "requestHeaders": {
                        "Accept": "application/json"
                    },
                    "url": "https://<tenant>.api.identitynow.com/v3/roles"
                },
                "displayName": "HTTP Action",
                "nextStep": "End Step - Success",
                "type": "action",
                "versionNumber": 2
            }
        }
    },
    "enabled": false,
    "executionCount": 1,
    "failureCount": 1,
    "trigger": {
        "displayName": "Every 2 hours at 30 mins after",
        "type": "SCHEDULED",
        "attributes": {
            "cronString": "30 */2 * * *",
            "frequency": "cronSchedule",
            "timeZone": "America/Chicago"
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![ipobeidi](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/ipobeidi/32/16000_2.png) [@ipobeidi](https://developer.sailpoint.com/discuss/u/ipobeidi)\
**Post date:** [May 20, 2024, 4:37pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323/4 "2024-05-20T16:37:29Z")

</div>

I know may sound strange but, try to remove the Header " Accept Json"

Best

---

<div class="post-metadata">

**Author:** ![dominick-miller](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/dominick-miller/32/29002_2.png) [@dominick-miller](https://developer.sailpoint.com/discuss/u/dominick-miller)\
**Post date:** [May 20, 2024, 4:39pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323/5 "2024-05-20T16:39:41Z")

</div>

I have removed the “Accept” header and reran my test. I still receive the same error message:

```auto
{
        "type": "WorkflowExecutionFailed",
        "attributes": {
            "error": "actionStep(HTTP Request) Err: task failed: activity error (type: sp:external:http:v2, scheduledEventID: 5, startedEventID: 6, identity: <id>): request failed (type: HTTP Response Returned a Client Error, retryable: false): request failed: 401 - 401 Unauthorized - {\"error\":\"JWT is required\"}"
        }
    }

```

---

<div class="post-metadata">

**Author:** ![GOKUL\_ANANTH\_M](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/gokul_ananth_m/32/14416_2.png) [@GOKUL\_ANANTH\_M](https://developer.sailpoint.com/discuss/u/GOKUL_ANANTH_M)\
**Post date:** [May 20, 2024, 4:41pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323/6 "2024-05-20T16:41:48Z")

</div>

Hi @dominick-miller ,

The workflow script you gave here is working fine. Check for the user scope.

---

<div class="post-metadata">

**Author:** ![ipobeidi](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/ipobeidi/32/16000_2.png) [@ipobeidi](https://developer.sailpoint.com/discuss/u/ipobeidi)\
**Post date:** [May 20, 2024, 4:43pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323/7 "2024-05-20T16:43:13Z")

</div>

Just build it your workflow on my Dev tennant and its working fine.

Maybe if you check the user Scope, yes the user who owns the workflow must have access to execute the steps.  
Now theres other place you could be receiving this error from?

---

<div class="post-metadata">

**Author:** ![dominick-miller](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/dominick-miller/32/29002_2.png) [@dominick-miller](https://developer.sailpoint.com/discuss/u/dominick-miller)\
**Post date:** [May 20, 2024, 4:55pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323/8 "2024-05-20T16:55:01Z")

</div>

This makes no sense. I am using the client credentials for my PAT and I am an org admin with all scopes. Good to know that my underlying workflow is fine, but I am concerned with why I cannot execute a seemingly basic workflow in my sandbox tenant as org admin with all scopes.

---

<div class="post-metadata">

**Author:** ![ipobeidi](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/ipobeidi/32/16000_2.png) [@ipobeidi](https://developer.sailpoint.com/discuss/u/ipobeidi)\
**Post date:** [May 20, 2024, 4:58pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323/9 "2024-05-20T16:58:05Z")

</div>

Hey Dominnick i know is frustrating. Lets try another thing.

Create a new ClientID and Secret with sp:scope:all put in the workflow and try again.  
It seems to be Access problem.

---

<div class="post-metadata">

**Author:** ![dominick-miller](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/dominick-miller/32/29002_2.png) [@dominick-miller](https://developer.sailpoint.com/discuss/u/dominick-miller)\
**Post date:** [May 20, 2024, 5:00pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323/10 "2024-05-20T17:00:02Z")

</div>

I have tried this and received the same error. What I am seeing in the error message above is `scheduledEventID: 5, startedEventID: 6`. Do you know what this corresponds to? There are less than 5 events in my workflow.

---

<div class="post-metadata">

**Author:** ![dominick-miller](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/dominick-miller/32/29002_2.png) [@dominick-miller](https://developer.sailpoint.com/discuss/u/dominick-miller)\
**Post date:** [May 20, 2024, 5:43pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323/11 "2024-05-20T17:43:29Z")

</div>

@colin_mckibben do you know of any Workflow limitations for client credentials? I was able to narrow this down and found that I am able to hit endpoints that do not require org\_admin permissions using credentials generated via API Management. However, I receive a 401 when trying to use my own org\_admin PAT credentials (I am also the workflow owner - not sure if this matters) to hit an API via the workflow. This same endpoint can be hit successfully via Postman using the same org\_admin PAT credentials.

---

<div class="post-metadata">

**Author:** ![baoussounda](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/baoussounda/32/13095_2.png) [@baoussounda](https://developer.sailpoint.com/discuss/u/baoussounda)\
**Post date:** [May 20, 2024, 5:47pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323/12 "2024-05-20T17:47:46Z")

</div>

Hi @dominick-miller,

Do you use Personnal access token (PAT) or Oauth client ?

If it’s PAT i suuggest you to generate Oauth clients with client credential grant and test it.

Best regards.

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [May 20, 2024, 6:26pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323/13 "2024-05-20T18:26:19Z")

</div>

That 401 “JWT is required” error happens when either the clientId and secret are missing, or not complete. I suggest you delete the HTTP Action and configure a new one.

---

<div class="post-metadata">

**Author:** ![dominick-miller](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/dominick-miller/32/29002_2.png) [@dominick-miller](https://developer.sailpoint.com/discuss/u/dominick-miller)\
**Post date:** [May 20, 2024, 6:40pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323/14 "2024-05-20T18:40:40Z")

</div>

@colin_mckibben I have deleted/recreated the HTTP action and created entirely new workflows and am observing the same behavior across all attempts.

To summarize:

1. ClientId & ClientSecret are not missing and are complete. They are, in fact, validated via Postman and I am hitting the same SailPoint endpoint as within the workflow.
2. PAT clientId & clientSecret (the same as (1)) do not work inside the SailPoint workflow. I receive a 401 JWT is required error. This is true for endpoints designated as requiring org\_admin permissions and endpoints not requiring org\_admin permissions.
3. When generating a new PAT (scoped for all) and using inside the SailPoint workflow, I still receive a 401 JWT is required error.
4. When generating a token via API Management (not scoped for org\_admin as this is a technical limitation of SailPoint) I receive a 403 unauthorized error for the org\_admin endpoint and a 200 successful for the non-org\_admin endpoint. This is expected behavior.

Therefore, these steps 1-4 lead me to conclude the following: There is either a bug within SailPoint where workflows cannot use PATs to hit internal endpoints OR this is intentional, in which case it is impossible to hit certain endpoints which require org\_admin permissions via SailPoint workflows (since we cannot scope ‘general’ tokens to have org\_admin permissions).

There is, of course, a third possibility where my sandbox instance is corrupt and is causing this strange behavior but I would like to verify that the two possibilities above are not true before coming to this conclusion.

Please let me know your thoughts.

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [May 20, 2024, 6:52pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323/15 "2024-05-20T18:52:33Z")

</div>

I tested PAT in my org and it works. I could only replicate your issue by deleting some characters from my client ID or by removing it altogether. This appears to be environment specific, in which case you should open a support ticket. Support has the means to investigate your tenant more closely to diagnose the issue.

---

<div class="post-metadata">

**Author:** ![dominick-miller](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/dominick-miller/32/29002_2.png) [@dominick-miller](https://developer.sailpoint.com/discuss/u/dominick-miller)\
**Post date:** [May 20, 2024, 7:05pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323/16 "2024-05-20T19:05:11Z")

</div>

Okay, this is good to know. There must be something strange going on in my sandbox environment. Thank you for the sanity check. I have opened a support ticket.

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [May 20, 2024, 7:10pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323/17 "2024-05-20T19:10:18Z")

</div>

Thanks Dominick. Don’t forget to report back here when you get a resolution from support. It could help others to hear what the resolution was.

---

<div class="post-metadata">

**Author:** ![baoussounda](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/baoussounda/32/13095_2.png) [@baoussounda](https://developer.sailpoint.com/discuss/u/baoussounda)\
**Post date:** [May 20, 2024, 7:26pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323/18 "2024-05-20T19:26:36Z")

</div>

Hi @dominick-miller,

For following test :  
" 4. When generating a token via API Management (not scoped for org\_admin as this is a technical limitation of SailPoint) I receive a 403 unauthorized error for the org\_admin endpoint and a 200 successful for the non-org\_admin endpoint. This is expected behavior."

What do you mean by : “not scoped for org\_admin as this is a technical limitation of SailPoint” ?

This not work also for your http request action in your workflow ?

---

<div class="post-metadata">

**Author:** ![dominick-miller](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/dominick-miller/32/29002_2.png) [@dominick-miller](https://developer.sailpoint.com/discuss/u/dominick-miller)\
**Post date:** [May 20, 2024, 8:09pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323/19 "2024-05-20T20:09:43Z")

</div>

SailPoint does not allow you to generate tokens via the API Management screen that have full capabilities. Even if you go to API Management \> Generate new token \> give it all scopes, there are some endpoints (quite a few, actually) that require ORG\_ADMIN permissions to execute. So even if you have sp:scope:all you cannot execute certain endpoints.

---

<div class="post-metadata">

**Author:** ![Mike\_Trachta](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/mike_trachta/32/4087_2.png) [@Mike\_Trachta](https://developer.sailpoint.com/discuss/u/Mike_Trachta)\
**Post date:** [May 24, 2024, 5:10pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323/20 "2024-05-24T17:10:29Z")

</div>

Hi All,

I’ve tried as well. All works with Postman

curl command:

```auto
curl --location --request POST 'https://<tenant>.api.identitynow.com/beta/sources/<SOURCEID>/load-accounts' \
--header 'Authorization: Bearer <REDACTED>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "disableOptimization": true
  }'

```

However, my test workflow does not:

```auto
{
	"name": "TEST",
	"description": "",
	"modified": "2024-05-24T17:04:39.869109823Z",
	"modifiedBy": {
		"type": "IDENTITY",
		"id": "<REDACTED>",
		"name": "<REDACTED>"
	},
	"definition": {
		"start": "HTTP Request",
		"steps": {
			"End Step - Success": {
				"displayName": "",
				"type": "success"
			},
			"HTTP Request": {
				"actionId": "sp:http",
				"attributes": {
					"authenticationType": "OAuth",
					"jsonRequestBody": {
						"disableOptimization": true
					},
					"method": "post",
					"oAuthClientId": "<REDACTED>",
					"oAuthClientSecret": "$.secrets.<REDACTED>",
					"oAuthCredentialLocation": "oAuthInHeader",
					"oAuthTokenUrl": "https://<REDACTED>.api.identitynow.com/oauth/token",
					"requestContentType": "json",
					"requestHeaders": {
						"Content-Type": "application/json"
					},
					"url": "https://<REDACTED>.api.identitynow.com/beta/sources/86cb9b1cfb9842089cd182a20df2544e/load-accounts"
				},
				"description": null,
				"displayName": "Unoptimized Aggregation",
				"nextStep": "End Step - Success",
				"type": "action",
				"versionNumber": 2
			}
		}
	},
	"creator": {
		"type": "IDENTITY",
		"id": "<REDACTED>",
		"name": "<REDACTED>"
	},
	"trigger": {
		"type": "SCHEDULED",
		"attributes": {
			"cronString": "30 */2 * * *",
			"frequency": "cronSchedule",
			"timeZone": "America/Chicago"
		}
	}
}

```

In case it helps, Dominick and I are in Frankfurt eu-central-1

It would be very helpful if there were a way for us to get a meaningful error message or view the request response

[Next page](https://developer.sailpoint.com/discuss/t/workflow-http-operation-401-jwt-required/57323.md?page=2)
