Scope parameter is not sent with my Oauth2 API credentials

Describe the issue/error/question

I had a HTTP module to connect with a custom query to BigQuery. I setup API access for my BigQuery instance (via Oauth2 credentials) and It very well a couple of months ago. I had a pause where I didn’t use it, and now I want to reuse those credentials for a new project. Unfortunalely it doesnt work anymore. Trying to reconnect, it throws an error. It is like n8n does not send scope parameter together with credentials.

I notice that recent changelog had some scope changes to oauth2 credentials, so I fear those might have affected how scopes are sen

What is the error message (if any)?

Google Authorization Window throws error:
Error 400: invalid request
Missing required parameter: scope

But as you see on screenshot, scope is supplied in the Oauth2 credentials - so the parameter should not be missing. Is there something I can do to solve this myself ?

Information on your n8n setup

  • v. 0.205.0
  • DB: PostgreSQL
  • Running n8n via Cloudron.io on a local server.

Hi @LE_Christensen, welcome to the community and sorry for the trouble.

This has been reported here and should be fixed with the next release:

In the meantime, you might want to consider downgrading to a previous version of n8n in order to avoid this problem.

2 Likes

Ah, amazing. Thank you for a quick answer @MutedJam :blush:

With the fast release roll n8n have, I can wait some days for fix.
I will automate as much as possible and handle small bits manually until this fix.

1 Like

This has been released now btw, so after upgrading to [email protected] the scopes should work again :slight_smile:

Hey @MutedJam

I’m attempting to authenticate the same way for a new connection to Azure AD and am having the same trouble when using the Microsoft OAuth 2 option.

It does work fine when using generic OAuth 2.0.

Hello @MutedJam ,
The above issue still exists in v0.207.1. I am unable to authorize google oauth2 api credentials. I believe the problem is not that the scope was not getting saved. It is present in decrypted credentials. The problem is that scope is being deleted from the object inorder to apply default values. This change has been carried out very recently to remove the default hidden scopes in some nodes from credentials. But for this to work we have to add another condition to check if the scope type is hidden. I am not sure about this. Please correct me if I am wrong. For now I am thinking to comment the block and build a custom image. Please advice if this would be appropriate in the whole picture.

Regards,
Mahesh

Hey @Mahesh_Thiru,

Are you seeing the issue when doing the initial authentication step or on token refresh? Can you share a bit more about what you are doing? The fix we put in place has worked during out testing so it would be handy to know what you are doing so we can see if the issue can be reproduced.

1 Like

@Jon Greetings.

I am trying to add a new credential via n8n UI. For example a google Oauth2 API credentials. I am adding Client Id, Client secret and scope. I save it and its getting saved. I can also see the scope in decrypted creds. What I suspect is that irrespective of the scope type being hidden or otherwise, its being deleted from decrypted data object before calling the auth url. If I comment that delete step out, the node works fine.

Hey @Mahesh_Thiru,

That is perfect I have managed to pick apart what you have said to reproduce the issue, It looks like while using Google OAuth2 API as a credential type it shows the scope message but if you use the OAuth2 API credential and fill out the information needed for Google OAuth it does work as expected so it looks like it is likely going to be an issue with just that one credential type.

It looks like someone has left a note on the PR that has fixed this for some PRs to say the same thing, I am going to make the team aware of this internally as well so we can get this resolved.

1 Like

Thank you for your analysis and confirmation @Jon. Great day ahead!!

1 Like

Hey @Mahesh_Thiru,

A PR has been put in for this one which can be found below if you wanted to look at the details, This should be available in the next release.

1 Like

Hello @Jon
I had verified the changes and tested the scenarios. Thank you for fixing this very quickly.

Regards,
Mahesh

2 Likes

Got released with [email protected]

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