OAuth2 API for Administrate

I’m trying to test a connection up to the GraphQL API as described here Administrate | DX | Core Docs | Authorization - I’m just struggling with the Authorization at the moment, for a standard OAuth seems to have a different set of fields in every source and sink.
I’m nearly there - it’s not just throwing an error at Administrate any more, but I’m getting an error where it comes back into n8n.
I’m currently on the desktop version, as I’m not completely set on n8n or Administrate yet.

Auth setup currently looks like this:

Clicking ‘Connect my account’ takes me through the Administrate authorization fine, but then I get this on the hooks.n8n.cloud return:
"Error: Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method).\n at getAuthError (C:\\Users\\me\\AppData\\Local\\Programs\\n8n\\resources\\app\\node_modules\\client-oauth2\\src\\client-oauth2.js:122:15)\n at C:\\Users\\me\\AppData\\Local\\Programs\\n8n\\resources\\app\\node_modules\\client-oauth2\\src\\client-oauth2.js:276:21\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at C:\\Users\\me\\AppData\\Local\\Programs\\n8n\\resources\\app\\node_modules\\n8n\\src\\credentials\\oauth2Credential.api.ts:290:23"

Information on your n8n setup

  • n8n version: 0.216.2
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (main):
  • Running n8n via desktop app:
  • Operating system: Windows 10

If I take the AuthURI parameters out, I get the same result (Administrate asks for which instance I am connecting to before processing the auth request, but the flow there is the same.

I just checked my Postman environment as that has been connected as well, and that seems to have the same parameters as n8n, but gets a token quite happily.

Hi @TomSpidge, I am very sorry for the trouble. OAuth2 error handling in n8n isn’t particularly good at the moment. This is a well known problem and I hope it’ll change at some point, for now this would require a bit of trial and error to sort.

I couldn’t find an option to create what this service calls an instance with a quickly created test account, so it might be worth playing around with some of the parameters from your end instead. For example the documentation you have linked suggests they are sending the response in the body rather than the header, so it might be worth changing this to begin with.

You are an absolute star - that worked perfectly. Sounds so simple, normally I’d just try everything but I must have been overconfident thinking I knew what it was doing at that point.
Now I’ve just got to figure out GraphQL and see what we can do with this

1 Like

Awesome, glad to hear that was it (for the authentication part at least) :slight_smile:

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