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

Mistake in code example #63

Closed jamesmogg closed 4 years ago

jamesmogg commented 4 years ago

There is a mistake in the code example for refreshing an access token. line 3 reads

console.log('Tokens refreshed : ' + JSON.stringify(authResponse.json()))

it should be

console.log('Tokens refreshed : ' + JSON.stringify(authResponse.getJson()))

The original code throws an error, which isn't immediately apparent as the error handling is looking for errors from the intuit api, and not from the callback, so it appears as undefined unless you look at the raw error.

MotorCityCobra commented 4 years ago

Another mistake is...

openid - for openID assertion include OAuthClient.scopes.Openid

It should be

openid - for openID assertion include OAuthClient.scopes.OpenId

Spent 45 minutes trying with and without every scope. Thanks H1B system!

abisalehalliprasan commented 4 years ago

Thanks @MotorCityCobra and @jamesmogg . Documentation is fixed in the release 2.0.1