How to use oauth

Comprehensive oauth code examples:

How to use oauth.OAuth2:

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 = {}

How to use oauth.OAuth:

15
16
17
18
19
20
21
22
23
24
passport.deserializeUser(function (user, cb) {
  userModel.findById(user._id, function (err, user) {
    cb(err, user);
  });
});
const consumer = new oauth.OAuth(
  'https://usosapps.amu.edu.pl/services/oauth/request_token',
  'https://usosapps.amu.edu.pl/services/oauth/access_token',
  process.env.USOS_CONSUMER_KEY,
  process.env.USOS_CONSUMER_SECRET,