Autodesk-Forge / forge-api-nodejs-client

Forge Node.js SDK: Provides Node.js SDK to help you easily integrate Forge REST APIs into the application
Apache License 2.0
124 stars 86 forks source link

Example on landing page fails #10

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hi there,

Just a heads up that there's a somewhat offputting moment in the (would be) very helpful example on the main readme page for this repo: the required scopes for the example are not in place. Further, the example fails silently. In order to see the error at all, I had to take the access token, log it, then do the getBuckets request via curl in order to see this:

Token does not have the privilege for this request.

That made it clear that I needed to find a page about scopes, which turned out to be this one:

https://developer.autodesk.com/en/docs/oauth/v2/overview/scopes/

So I could then figure out to add 'bucket:read' to this:

var oAuth2TwoLegged = new ForgeSDK.AuthClientTwoLegged(CLIENT_ID, CLIENT_SECRET, [
    'data:read',
    'data:write'
], autoRefresh);

Updating the docs would be very much appreciated by future devs, I'm sure. Thanks!

gregra81 commented 7 years ago

Thanks!