BUG: Predefined Credential Type: Auth0 Management API

Describe the problem/error/question

In the HTTP Request node, when Adding credentials to the Predefined Credential Type> Auth0 Management API

  • Auth0 Domain (no https:// prefix or path)
  • ClientID
  • ClientSecret

Checked with curl from a local machine - all works.

curl --request POST \
  --url 'https://dev-sdfsd-ghf.us.auth0.com/oauth/token' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data grant_type=client_credentials \
  --data 'client_id=sdfdsfdsfd' \
  --data 'client_secret=safsdf-ssdfdsf' \
  --data 'audience=https://dev-sdfsd-ghf.us.auth0.com/api/v2/'

The result of curl:

{"access_token":"eyJ...pg","scope":"read:users","expires_in":86400,"token_type":"Bearer"}%

And then I can get list of users with the obtained token like this:

curl --request GET \
  --url https://dev-b44r-ubv.us.auth0.com/api/v2/users \
  --header 'authorization: Bearer eyJ...pg'

result:

[{"created_at":"2222-02-35T14:36:32.321Z","email":"[email protected]","email_verified":true,"identities":[{"connection":"Password-Authentication","provider":"auth0","user_id":"3jhg3455467abf99","isSocial":false}],"name":"[email protected]","nickname":"super","picture":"png","updated_at":"2224-01-45T38:73:12.924Z","user_id":"auth0|dfgfddfhfhg99","last_login":"2224-01-45T38:73:12.924Z","last_ip":"dfhed","logins_count":43}]%

What is the error message (if any)?

Couldn’t connect with these settings

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

If you click on more details does it say anything else? Can you also try and use the credential in the http request node and see what comes back?

Request failed with status code 403

While with CURL, on local computer all works as expected.

The 403 is forbidden :thinking: I suspect we may have a typo in the credential test we use or the credential doesn’t have access to that endpoint.

If you try to use the credential in an http request node does it work there?

Tried those credentials a million times. But going to try one more time just in case

Nope, I didn’t make a typo and I’m just copy-pasting the clientid, clientsecred & domain.
And As I showed, it works with exact same credentials from my local machine… @Jon
Tried it again - doesn’t work.

If I import my curl into the HTTP Request node, n8n tells me it executes, but no output is provided, which is not expected.

curl --request POST \
  --url 'https://dev-sdfsd-ghf.us.auth0.com/oauth/token' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data grant_type=client_credentials \
  --data 'client_id=sdfdsfdsfd' \
  --data 'client_secret=safsdf-ssdfdsf' \
  --data 'audience=https://dev-sdfsd-ghf.us.auth0.com/api/v2/'

It is supposed to output something like this:

{ "access_token":"fdghf.dfgfd.dfgfd",
  "scope":"read:users create:users",
  "expires_in":86400,
  "token_type":"Bearer"
}

I still need to look at this, I will do it first thing in the morning.

Hey @Di_B,

I have just taken a look and for me this is working as expected, In Auth0 did you create a machine to machine client?

Originally in Auth0, the Application I created was of Type: Regular Web Application. Also, I had a Development Environment.

I have updated the environment to be Production and tested the Application Type: Machine to Machine Applications. Same problem.

Also, I created a new US Tenant, of production Environment Tag, created a new application, and tested -the same result.

I used the “API Explorer Application” Application of the “Machine to Machine” type,
And the API Explorer Application’s Client ID.
As for the Client Secres, On the API Explorer Application application page, I opened the Credential tab, and in the authentication Section, there is selected by default, “Client Secret (Post)” is currently selected, and there is a Client Secret, which I used in n8b node. Same result.
Also, I tried different options, created another app; location of Native type, and entered it’s Client ID & Secrets - no luck.

Hey @Di_B,

For my EU dev instance I added a Machine to Machine application and used the 3 values for domain, ID and Secret on the Settings page

I also made sure that under APIs I had most of them enabled, For the credential test we use /api/v2/clients so it could be worth trying the credential in an http request node and using https://your-domain//api/v2/clients` with the credential selected and see what the output is if you set it to output the full response and to never error.