# Workflow External Trigger OAuth 500 error

**URL:** <https://developer.sailpoint.com/discuss/t/workflow-external-trigger-oauth-500-error/29625>\
**Category:** SHF Discussion and Questions\
**Tags:** workflows, sailpoint-identity-security\
**Created:** [February 8, 2024, 8:23pm UTC](https://developer.sailpoint.com/discuss/t/workflow-external-trigger-oauth-500-error/29625 "2024-02-08T20:23:43Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![awyss](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/awyss/32/37310_2.png) [@awyss](https://developer.sailpoint.com/discuss/u/awyss)\
**Post date:** [February 8, 2024, 8:23pm UTC](https://developer.sailpoint.com/discuss/t/workflow-external-trigger-oauth-500-error/29625/1 "2024-02-08T20:23:43Z")

</div>

I’m trying to create an OAuth client ID and secret for an workflow external trigger per this API doc: [Generate External Trigger OAuth Client](https://partner6037.api.identitynow-demo.com/beta/workflows/0b91ffc2-4705-4850-818c-6ff0dce45e91/external/oauth-clients)

I’m getting back a 500 internal server error though indicating that there’s an invalid character somewhere in the call. Has anyone seen this before?

(I’m running the call in postman. Below is the curl code snippet and resulting error response)

> curl --location --request POST ‘[https://tenant.api.identitynow-demo.com/beta/workflows/0b91ffc2-4705-4850-818c-6ff0dce45e91/external/oauth-clients](https://tenant.api.identitynow-demo.com/beta/workflows/0b91ffc2-4705-4850-818c-6ff0dce45e91/external/oauth-clients)’ \   
> –header ‘Authorization: Bearer redacted’

```auto
{
    "detailCode": "Internal Server Error",
    "trackingId": "5a66e956fbfa4cfea2a43299d325d94f",
    "messages": [
        {
            "locale": "en-US",
            "localeOrigin": "DEFAULT",
            "text": "invalid character '\\n' in string literal"
        }
    ]
}

```

---

<div class="post-metadata">

**Author:** ![jesvin90](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/jesvin90/32/5301_2.png) [@jesvin90](https://developer.sailpoint.com/discuss/u/jesvin90)\
**Post date:** [February 9, 2024, 11:40am UTC](https://developer.sailpoint.com/discuss/t/workflow-external-trigger-oauth-500-error/29625/2 "2024-02-09T11:40:17Z")

</div>

Hi Adam,

Can you please check and make sure that the workflow that you are calling is working fine while testing it.?

I am doubting if it is something wrong with the actual WF.

---

<div class="post-metadata">

**Author:** ![awyss](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/awyss/32/37310_2.png) [@awyss](https://developer.sailpoint.com/discuss/u/awyss)\
**Post date:** [February 9, 2024, 2:09pm UTC](https://developer.sailpoint.com/discuss/t/workflow-external-trigger-oauth-500-error/29625/3 "2024-02-09T14:09:17Z")

</div>

I can test the workflow in the sailpoint UI but it has a “loop” at the end which is an HTTP request to re-trigger the same workflow.

My personal admin PAT gets a 401 unauthorized when trying to fire the external trigger for the workflow so I assumed we had to use the originally mentioned call to make a client ID/secret in order to execute the external trigger. (Yes, my PAT has the scope to execute workflows)

---

<div class="post-metadata">

**Author:** ![jesvin90](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/jesvin90/32/5301_2.png) [@jesvin90](https://developer.sailpoint.com/discuss/u/jesvin90)\
**Post date:** [February 9, 2024, 2:35pm UTC](https://developer.sailpoint.com/discuss/t/workflow-external-trigger-oauth-500-error/29625/4 "2024-02-09T14:35:04Z")

</div>

I would try replacing the loop part with an end node to see if that works in generating the client secret.

If that works, then add the loop part back and see how the WF behaves.

---

<div class="post-metadata">

**Author:** ![anagha](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/anagha/32/8194_2.png) [@anagha](https://developer.sailpoint.com/discuss/u/anagha)\
**Post date:** [February 9, 2024, 5:11pm UTC](https://developer.sailpoint.com/discuss/t/workflow-external-trigger-oauth-500-error/29625/5 "2024-02-09T17:11:35Z")

</div>

Hi Adam,

You can try the following API instead of the curl command in postman.

POST [https://sailpoint.api.identitynow.com/beta/workflows/:id/external/oauth-clients](https://sailpoint.api.identitynow.com/beta/workflows/:id/external/oauth-clients)

Pass the Workflow ID and this would generate Client ID,Secret and URL

---

<div class="post-metadata">

**Author:** ![awyss](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/awyss/32/37310_2.png) [@awyss](https://developer.sailpoint.com/discuss/u/awyss)\
**Post date:** [February 12, 2024, 3:26pm UTC](https://developer.sailpoint.com/discuss/t/workflow-external-trigger-oauth-500-error/29625/6 "2024-02-12T15:26:55Z")

</div>

Hi Anagha, if you look at my original message, that API call is listed as what I was trying to do. I get back a 500 error stating there’s an invalid character in string literal.

```auto
    "detailCode": "Internal Server Error",
    "trackingId": "5a66e956fbfa4cfea2a43299d325d94f",
    "messages": [
        {
            "locale": "en-US",
            "localeOrigin": "DEFAULT",
            "text": "invalid character '\\n' in string literal"
        }
    ]
}

```

---

<div class="post-metadata">

**Author:** ![awyss](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/awyss/32/37310_2.png) [@awyss](https://developer.sailpoint.com/discuss/u/awyss)\
**Post date:** [February 12, 2024, 3:28pm UTC](https://developer.sailpoint.com/discuss/t/workflow-external-trigger-oauth-500-error/29625/7 "2024-02-12T15:28:41Z")

</div>

@colin_mckibben I’m going to tag you in if you don’t mind. I’m still working on your reassignment workflows and this is what I’m running into now trying to get the external trigger working for the “loop” part.

---

<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:** [February 12, 2024, 9:38pm UTC](https://developer.sailpoint.com/discuss/t/workflow-external-trigger-oauth-500-error/29625/8 "2024-02-12T21:38:39Z")

</div>

You can generate the client ID and client secret for an external trigger directly in the workflows UI. Just click on the “External Trigger” step and there is a button to create new access token.

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/5/50071d987bc52d840f63fea883e5beed4d4a38eb.png)

The client ID and secret will be provided on the next page.

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/d/d34b8d613349cd436ea264fc931eff346b352b54.png)

---

<div class="post-metadata">

**Author:** ![awyss](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/awyss/32/37310_2.png) [@awyss](https://developer.sailpoint.com/discuss/u/awyss)\
**Post date:** [February 12, 2024, 10:01pm UTC](https://developer.sailpoint.com/discuss/t/workflow-external-trigger-oauth-500-error/29625/9 "2024-02-12T22:01:48Z")

</div>

🤦‍♂️

Ok, I tried it that way and I’m still getting the same error message.

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/a/af770e8d5b0df0129d9f4582901e9cd8504e800b.png)

---

<div class="post-metadata">

**Author:** ![awyss](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/awyss/32/37310_2.png) [@awyss](https://developer.sailpoint.com/discuss/u/awyss)\
**Post date:** [February 12, 2024, 10:06pm UTC](https://developer.sailpoint.com/discuss/t/workflow-external-trigger-oauth-500-error/29625/10 "2024-02-12T22:06:33Z")

</div>

@colin_mckibben I figured it out. 🤦‍♂️

The description for the external trigger is causing it to error when generating the token.

```auto
Must use the following payload when invoking this trigger:
{
  "previousOwnerId": "{identity ID}",
  "newOwnerId": "{identity ID}"
}

```

---

<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:** [February 12, 2024, 10:19pm UTC](https://developer.sailpoint.com/discuss/t/workflow-external-trigger-oauth-500-error/29625/11 "2024-02-12T22:19:57Z")

</div>

> [@awyss](#):
>
> The description for the external trigger is causing it to error when generating the token.
> 
> ```auto
> 
> ```

Oh no! I will attempt to reproduce this and then open a bug report to the engineering team.

---

<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:** [February 13, 2024, 2:15pm UTC](https://developer.sailpoint.com/discuss/t/workflow-external-trigger-oauth-500-error/29625/12 "2024-02-13T14:15:16Z")

</div>

@awyss I was able to reproduce this issue and I submitted a bug report for it. PLTWRKFLW-3915 for my record.

---

<div class="post-metadata">

**Author:** ![awyss](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/awyss/32/37310_2.png) [@awyss](https://developer.sailpoint.com/discuss/u/awyss)\
**Post date:** [February 13, 2024, 2:58pm UTC](https://developer.sailpoint.com/discuss/t/workflow-external-trigger-oauth-500-error/29625/13 "2024-02-13T14:58:34Z")

</div>

Cool thank you Colin! Should we put a note on your blog post about the reassignment workflows so people know they might need to clear or edit the description for the external triggers?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [April 13, 2024, 2:58pm UTC](https://developer.sailpoint.com/discuss/t/workflow-external-trigger-oauth-500-error/29625/14 "2024-04-13T14:58:43Z")

</div>

Closed on April 13, 2024, 2:58pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
