2 legged Token test

node v6.12.2
version: master
endpointsharetweet
var express = require("@runkit/runkit/express-endpoint/1.0.0"); var router = express(module.exports); var cors = require('cors') // Forge NPM var forgeSDK = require('forge-apis'); router.use(cors()) router.get("/", (req, res) => { var request = new forgeSDK.AuthClientTwoLegged(process.env.FORGE_CLIENT_ID, process.env.FORGE_CLIENT_SECRET, [process.env.FORGE_VIEWER_SCOPE]) request.authenticate().then(function (credentials) { res.send({ access_token: credentials.access_token, expires_in: credentials.expires_in }); }) })
Created from: https://forge.autodesk.com/blog/runkit-nodejs-playground-forge-sample
Loading…

no comments

    sign in to comment