Oauth2 "An invalid scope name was provided" Error

oauth
contacts

#1

HI!. I am trying to refactor auth to Oauth2. But i can’t build correct auth url or something wrong with your system. NOw all that i can get is "An invalid scope name was provided. Please contact the integrator."
This is my url "https://app.hubspot.com/oauth/authorize?client_id=xxxxxxxxxx&redirect_uri=https://widgets.widgetor.ua.calcus.local:3001/ssl/hubspot/get_token&scope=contacts"
Also this is my app scope settings: http://joxi.ru/BA00OkgIJq8jMA


#2

Hi @stopanko

OAuth 2.0 does use different scopes that Oauth 1 did (there’s a full list of the supported scopes for OAuth 2.0 here, but contacts is a valid scope for Oauth 2.0, and I’m not seeing that error when trying your authorization URL with a test client_id.

The issue here would be with the scopes you have in the app settings compared to the scopes in your authorization URL. Any scopes that you have checked in the app must be included in the authorization URL. As an example, you have the content and forms scopes check in the app, but they’re not in the authorization URL.

I double check to make sure that the correct error message gets displayed for this case, and we’ll get that fixed if we’re showing the wrong error.


#3

HI! Thanks for you response. I investigated what exactly happens. First of all this note:
“Developer portals will not have access to any of these scopes, and cannot be authorized with an app. You will need to create a test portal to test authorization.”
– So i can’t use developer account if a want get access to the auth app.

Second issue. I putt only “contacts” scope to scope parameter and chose test-portal account. -> i was redirected to accepting permissions page (correct result).

But second note : “Only paid Marketing subscriptions will have API access to the scopes and tools listed below for Marketing accounts. Marketing Free accounts will not have API access to any of the Marketing-only scopes.”

– So if i put forms scope i will get the same issue, because my account have free subscription.
Thanks for you Response!


#4

This behaviour also confirmed. **scopes should be separated by %20 ** -> &scope=contacts%20files