I'm currently working on implementing web service data actions to call an external API service using User Defined OAuth credentials. Since I'm relatively new to this, I've hit a roadblock with the authentication process and could really use some guidance.
I've attached the screenshots of the configuration I've been working with so far (please see the attached images for context).
loginUrl : https/[ngrok_temp_url]/token
ClientId: obtained from OAuth Client Credentials Type
ClientSecret: obtained from OAuth Client Credentials Type
When I execute this auth action using the base URL from Ngrok hosted on port 443
Execute: The server encountered an unexpected condition which prevented it from fulfilling the request.
REST call for action execute failed. Message: Request to backend service failed. Response from web service: ngrok gateway error The server returned an invalid or incomplete HTTP response. ERR_NGROK_3004 [bd4f5247-8948-4543-806d-578434d83557]
Error on my localhost:
code 400, message Bad request version
I'm not sure what kind of response or redirection is expected from the loginUrl. I need advice on setting up my server to properly process the POST request that involves OAuth credentials. What exactly needs to be returned when the LoginUrl is hit?
Any help, examples, or resources you could provide would be greatly appreciated. Thanks in advance for your support!
When you created your integration (as a user defined OAuth) a default 'auth' data action would have been created for you. Thuis may require some changes for the token generation to happen but most likely works without change.
To see that getting the token works, you can run the data action in test mode - greed = good, red = bad
Also look at the test output steps. That should let you see if the requestTemplateUrl is resolving to the expected value.
And is the request body template what you need? The default action created is just and example of an OAuth request that assumes the the request if form-url-encoded.
I am attaching a screenshot below and I apologize if this question seems trivial, but I am having some difficulty understanding how to handle the POST request on my end. Currently, I am using Flask, localhost is at 443, and it returns a 400 error.
If I am understanding correctly, you are getting a 400 response from your token endpoint in both Data Actions and in other tools like postman. If that is the case, we are probably not going to be able to help you much until you can get your request to work in postman.
Is the token endpoint on a locally running endpoint that is publicly exposed via ngrok? One possibility is that you need ngrok to rewrite the request host header: