How to use the OAuth2 function from oauth

Find comprehensive JavaScript oauth.OAuth2 code examples handpicked from public code repositorys.

15
16
17
18
19
20
21
22
23
24
const callbackURL = `${baseURL}/auth/strategy/callback`
const authorizationURL = `${forgeURL}/account/authorize`
const tokenURL = `${forgeURL}/account/token`
const userInfoURL = `${forgeURL}/api/v1/user`

const oa = new OAuth2(clientID, clientSecret, '', authorizationURL, tokenURL)

const version = require('../package.json').version

const activeUsers = {}
fork icon0
star icon2
watch icon0

9
10
11
12
13
14
15
16
17
18
  BUFFER_LINKEDIN_PROFILE, BUFFER_LINKEDIN_PAGE, BUFFER_LINKEDIN_GROUP,
  SCHEDULE_TYPE_VARIANT
} = require('shared/constants');
const fetch = require('node-fetch');
const oauth = require('oauth');
var oauth2 = new oauth.OAuth2(process.env.BUFFER_APP_ID,
  process.env.BUFFER_APP_SECRET,
  BUFFER_API_URL,
  'oauth2/authorize',
  'oauth2/token.json',
fork icon0
star icon0
watch icon0

+ 8 other calls in file