intuit / oauth-jsclient

Intuit's NodeJS OAuth client provides a set of methods to make it easier to work with OAuth2.0 and Open ID
https://developer.intuit.com/
Apache License 2.0
121 stars 156 forks source link

I'm having scope issues #66

Closed MotorCityCobra closed 4 years ago

MotorCityCobra commented 4 years ago

Using the sample I a long error on the company info sample app page button that says 'The access token does not have sufficient scope'.
It gives the token and doesn't seem to have a problem with anything else.
My scopes are as follows,

const authUri = oauthClient.authorizeUri({scope:[OAuthClient.scopes.Accounting, OAuthClient.scopes.OpenId, OAuthClient.scopes.Profile, OAuthClient.scopes.Email, OAuthClient.scopes.Phone, OAuthClient.scopes.Address],state:'intuit-test'});

Side note: in all app examples I've seen 'OAuthClient.scopes.OpenId' is spelled 'OAuthClient.scopes.Openid', or 'OAuthClient.scopes.OpenID' which causes the authorization window not to load and was a terribly time consuming bug. All your sample apps, code, and documentation need more attention to detail.

MotorCityCobra commented 4 years ago

Changed

const url = oauthClient.environment == 'production' ? OAuthClient.environment.sandbox : OAuthClient.environment.production ;

To

const url = OAuthClient.environment.production ;