Legacy Dev Forum Posts

 View Only

Sign Up

User Defined (OAuth) credential type with Azure AD

  • 1.  User Defined (OAuth) credential type with Azure AD

    Posted 06-05-2025 18:41

    Taras | 2020-04-30 15:49:58 UTC | #1

    Hi, I would like to use User Defined credential type based on Azure AD. I've created integration, configured everything as described in the https://help.mypurecloud.com/articles/how-to-use-the-user-defined-oauth-credential-type

    And problem occurs

    8. Execute: The request could not be understood by the server due to malformed syntax.

    • REST call for action execute failed. Message:Request to backend service failed. Response from web service: {"error":"invalidrequest","errordescription":"AADSTS900144: The request body must contain the following parameter: 'granttype'.\r\nTrace ID: eb5061e0-1adb-41ae-b00e-163c46c41800\r\nCorrelation ID: 9e2a1ea8-c268-4a1e-8810-3818f9ff6930\r\nTimestamp: 2020-04-28 09:35:23Z","errorcodes":[900144],"timestamp":"2020-04-28 09:35:23Z","traceid":"eb5061e0-1adb-41ae-b00e-163c46c41800","correlationid":"9e2a1ea8-c268-4a1e-8810-3818f9ff6930","error_uri":"https://login.microsoftonline.com/error?code=900144"} [f398e370-5bd9-47fc-bd44-6bb2c701e7c2]

    At the same time from the Postman everything is fine:

    Could you please help with Purecloud Auth configuration.

    Thanks, Taras


    Jason_Mathison | 2020-04-30 16:14:01 UTC | #2

    Have you tried it without setting the Tranfer-Encoding header?


    Jerome.Saint-Marc | 2020-04-30 16:20:31 UTC | #4

    And maybe setting your Request Body Template to: granttype=clientcredentials

    I think form urlencoded works with = and not :


    Taras | 2020-04-30 16:30:27 UTC | #5

    Thanks very much. Works with "="


    Taras | 2020-05-21 15:56:50 UTC | #6

    I can run auth action

    Data action configuration: { "requestUrlTemplate": "{just removed url}/globalpayment/${input.conversationId}", "requestType": "GET", "headers": { "Transfer-Encoding": "buffered", "Content-Type": "application/json", "Authorization": "${authResponse.tokentype} ${authResponse.accesstoken}" }, "requestTemplate": "${input.rawRequest}" }

    In the Postmen everything is fine, but from the Purecloud such message. How to see detailed error message, and how to check taken in the header?

    4. Perform authentication: There was an issue validating the credentials.

    • REST call for action execute failed. Message:Request to backend service failed. To see error details, use test mode to execute the action, or execute request in Postman or other REST tools. [9dc7b605-8a7b-433d-985c-99c70d465398]

    { "message": "There was an issue validating the credentials.", "code": "invalid.credentials", "status": 400, "entityName": "basicAuth", "messageParams": {}, "contextId": "9dc7b605-8a7b-433d-985c-99c70d465398", "details": [ { "errorCode": "ACTION.AUTHENTICATION" } ], "errors": [ { "message": "REST call for action execute failed. Message:Request to backend service failed. To see error details, use test mode to execute the action, or execute request in Postman or other REST tools. [9dc7b605-8a7b-433d-985c-99c70d465398]", "code": "INVALID_CREDENTIALS", "status": 404, "messageParams": {}, "details": [], "errors": [] } ] }


    Taras | 2020-05-21 17:04:43 UTC | #7

    Used few hours trying different things.

    As I understand it is possible to run data action only when Auth Data Action is PUBLISHED.

    Please, put this information to the documentation or into error description that "Auth Data Action is not PUBLISHED" or something like that, because at the moment is not clear what is wrong.


    Jason_Mathison | 2020-05-21 17:44:20 UTC | #8

    Hi Taras,

    As far as I can tell there was no issue with the "Auth Data Action" not being published. Publishing is done to ensure that the input and output contract for an action will never change again. Auth actions always have fixed input and output contracts, so they are considered published as soon as they are created.

    For the contextId that you posted a couple of hours ago, the Auth Data Action was executed, and the the Azure login URL returned a 404. Is it possible that you fixed your issue by modifying the URL template of your Auth Data Action?

    --Jason


    Taras | 2020-06-02 12:49:48 UTC | #9

    Hi Jason,

    Thanks. I think you are right.

    Best regards, Taras


    system | 2020-07-03 12:49:31 UTC | #10

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


    This post was migrated from the old Developer Forum.

    ref: 7687