HTTP Request - How to change the default Authorization link to get Authorization code for OAuth 2.0?

Hi guys,

I try to connect to an Authorization link to get an Authorization Code, but I noticed an issue while getting the code.

In setting up the Authorization 2.0, when I hit the connect button, it gives me the link with client_id in browser to get the code:

But to get the code as stating in the API website, you have to access to this link with app_id, not client_id

When I change the client_id to app_id manually, i get an error after confirming connection.

Is there a way to change the client_id to app_id to get the Authorization code?

Thanks in advance.

Hey @semighoti,

At the moment there isn’t a way I can think of to change that but have you tried adding app_id to the URI parameters options to see if that works?

Hi @Jon Thanks for the response.

The app_id added to the URI parameters option worked for the confirmation of the app connecting to the API, but after that, i got a message Invalid app_id.

Screenshot from 2022-11-15 06-36-26

Should I do anything else to the Scope field?

Thanks in advance

Hey @semighoti,

I am not sure if it needs anything in the scope field that would depend on what you are connecting to. It looks like the other end doesn’t like the app id though either that or there is something else odd going on.

Hi @Jon Thanks for the quick response.

I noticed that the link that showed the {“code”:0,“message”:“The OAuth2 callback state is invalid!”,“hint”:“”} has unchanged State at the end.

And my account has this as well

In the instruction how to get Access_token code to call API, it mentions that I need to set u Code Challenge and State, which I don’t know how and there is no option to input that into N8n, to get the code.

Do I have to deal with Code Challenge and State to get the Access Token?3

Thanks in advance.

Hey @semighoti,

We automatically handle the state so you wouldn’t need to worry about that… or shouldn’t need to anyway.

1 Like

Hi, @Jon Thanks for the response. I appreciate it very much.

Let me check the other end. Thanks

1 Like

Hi @Jon Following to this issue, I have gotten another problem.

Not sure what happen and what to do to the “insufficient parameters for OAuth2 call back”.

Do you think I can connect to the API if I keep trying? I got stuck to the connecting error for 2 days already T.T

This is the API (English at the bottom) that I try to connect to

Hey @semighoti,

I have found the issue, the API doc mentions that they use PKCE which we currently don’t support but it is on a list of things that @RicardoE105 is looking into.

For now you might have to manually build out the authentication flow using http request and webhook nodes which isn’t ideal.

Thanks @Jon I’m able to connect the webhook to the API, but not the HTTP request node.

That’s what I thought about the API. I have called HTTP request successfully many times on many nodes/apps, but not on this one. This API looks weird to me tbh.

Thanks again @Jon I appreciate it very much. Let me try to build up HTTP request for this one then.

Yeah, this has been on my To-do forever. I got it working here, but sadly we needed to fork the npm package that we use to handle the oAuth2 flow, and that does not feel right. When I have the time to remove the library, we will be able to add proper support for PKCE without making compromises.