Skip to content

Commit 77df84d

Browse files
committed
bump version
1 parent abd055a commit 77df84d

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "forge-apis",
3-
"version": "0.8.0",
3+
"version": "0.8.1",
44
"description": "The Forge Platform contains an expanding collection of web service components that can be used with Autodesk cloud-based products or your own technologies. Take advantage of Autodesk’s expertise in design and engineering.",
55
"license": "Apache-2.0",
66
"main": "src/index.js",

samples/oauthSample.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*jshint esversion: 9 */
2+
3+
const ForgeSDK = require('./../src/index');
4+
5+
// TODO - insert your CLIENT_ID and CLIENT_SECRET
6+
const FORGE_CLIENT_ID = process.env.FORGE_CLIENT_ID || 'your forge client id';
7+
const FORGE_CLIENT_SECRET = process.env.FORGE_CLIENT_SECRET || 'your forge client secret';
8+
9+
// Initialize the 2-legged oauth2 client
10+
const oAuth2TwoLegged = new ForgeSDK.AuthClientTwoLegged(FORGE_CLIENT_ID, FORGE_CLIENT_SECRET,
11+
['data:write', 'data:read', 'bucket:read', 'bucket:update', 'bucket:create'], true);
12+
13+
// oAuth2TwoLegged.authenticate()
14+
// .then((credentials) => {
15+
// console.log("**** Got Credentials", credentials);
16+
// })
17+
// .catch (err => {
18+
// console.error('\x1b[31m Error:', err, '\x1b[0m');
19+
// });
20+
21+
(async () => {
22+
try {
23+
let credentials = await oAuth2TwoLegged.authenticate();
24+
console.log("**** Got Credentials", credentials);
25+
} catch (ex) {
26+
console.error('\x1b[31m Error:', ex, '\x1b[0m');
27+
}
28+
})();

0 commit comments

Comments
 (0)