Generic Oauth2 API - Unable to sign without access token

Describe the problem/error/question

I’m trying to setup Generic Oauth2 authentication for Lazada Open API. And I always get error “Unable to sign without access token”. I was able to get access token manually and sign manually. But I can’t make it work using Generic Oauth2 credentials.

Additional info
Link to Lazada API doc: Open Platform

This is the flow, using which I was able to manually generate access token

What is the error message (if any)?

ERROR: Unable to sign without access token

Details

Time

1/30/2024, 9:50:05 PM

Item Index: 0

HTTP Code

rejected

Stack

NodeApiError: Unable to sign without access token
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js:1540:27)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:698:19)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:656:53

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.25.1
  • Database (default: SQLite): postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own, main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system: Debian 11 64bit

Hi @Alex_Goryainov :wave: This is hard to say as it doesn’t seem I can sign up to this personally and give this a test - would you be able to show your Oauth2 credential configuration settings (while obviously redacting anything that would be sensitive information like tokens and secrets)? That might help us figure this out.

Hey @EmeraldHerald , see the screenshots


Basically I tried changing options in any possible way. But anyway I’m pretty sure that’s it something in the credentials configuration, since I was able to make it work manually.

Manually I did the following:

  1. Generated link for authorization using the following pattern:
    Authorize - LAZADA Open Platform{app call back url}&client_id=${appkey}
  2. Authorized using the link
  3. After being redirect to https://----/rest/oauth2-credential/callback?code=(code is here) copied the code
  4. Used the code in the workflow to get access token
  1. Then I just reused this workflow with minor adjustments (replaced code with access token and added other fields as needed by specific API endpoints) to make requests to API.

When configuring credentials, it shows that account is connected, but that’s it. When trying to make a request to API there’s always this error.

Though I just noticed that when configuring credentials you can only select to send credentials either in body or as Basic Auth. While manually I did it as query parameters. Could it be the reason?

Any ideas? Anyone?