Missing parameter: \"code\" is required oAuth 2.0

Hi everyone, I’m not a developer, and I’m quite new to n8n.

When trying to create an oauth 2.0 for Moloni (Moloni Developers | Moloni API | Autenticação)
I’m getting this message: Missing parameter: "code" is required

I know the parameter I need is in the URL:


But I’m having trouble understanding where it should go on the configuration

Can anyone help?

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:

hello @suardim

can you copy the code from the callback URL (first screen) and paste it into the second URL directly? (last part, your_authorization_code)
https://api.moloni.pt/v1/grant/?grant_type=authorization_code&client_id=[your_developer_id]&redirect_uri=[your_callback_url]&client_secret=[your_client_secret_code]&code=[your_authorization_code]

And what n8n version do you have? I don’t see that node in the n8n

I tried copying it.
But the authorization code keeps changing after each request.

my n8n is 0.233.1

Anyone can help?

The error is created during the code-exchange part of the oauth flow.
My theory is that this is some old bug in the oauth handler.

0.233.1 is a bit old now. We’ve rewritten quite a lot of the oauth2 related code since.
Can you please try using the latest version of n8n instead?

1 Like

I need to migrate the whole thing.
But thanks, I will check if in the new n8n version the problem is solved.

1 Like

After upgrading to the last version of n8n the problem persists.

Is there somewhere that I need to insert the code information?
Because the problem still looks like n8n doesn’t receive the code part for the oauth2, I’m having that problem with more than one service that requires oauth2.

Error: The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.

More details

{“error”:“invalid_request”,“error_description”:“Missing parameter: "code" is required”}

Failed to connect. The window can be closed now.

I still think that I am doing something wrong.

Is the source code for this credential available somewhere for us to debug?

I don’t think you would have the credentials needed

But the same happend with olx.
https://developer.olx.pt/en

It’s free to create an app.
let me know if I can help with that, or providing any other information.
It’s really something that’s bothering me

Is there anything else I can try?

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