Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //code
- // dependencies
- const express = require('express');
- const http = require('https');
- const bodyParser=require('body-parser');
- const jsforce = require('jsforce');
- const server = express();
- var db=require('mysql');
- var AuthenticationClient = require('auth0').AuthenticationClient;
- var auth0 = new AuthenticationClient({
- domain: 'xxx',
- clientId: 'xxx',
- clientSecret: 'xxx'
- });
- auth0.clientCredentialsGrant(
- {
- audience: 'https://x/api/v2/',
- scope: 'read:users'
- },
- function(err, response) {
- if (err) {
- //res.status(500);
- }
- else{
- req.auth0AccessToken = response.access_token;
- console.log('Val come-->'+req.auth0AccessToken);
- return next();
- }
- });
Add Comment
Please, Sign In to add comment