Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

248
Views
Calendly : generation of access code on server side (without redirection)

As showcased on the calendly demo app link is there any way create access token and refresh token on server side only, because as per their Documentation it is not listed anywhere.

I want to achieve something similar.

demo app code:

const OAuth2Strategy = require('passport-oauth2').Strategy;

const strategy = new OAuth2Strategy(
    {
        authorizationURL: CALENDLY_AUTH_BASE_URL + '/oauth/authorize',
        tokenURL: CALENDLY_AUTH_BASE_URL + '/oauth/token',
        clientID: CLIENT_ID,
        clientSecret: CLIENT_SECRET,
        callbackURL: REDIRECT_URI
    },
    async (accessToken, refreshToken, _profile, cb) => {
        const calendlyService = new CalendlyService(accessToken, refreshToken);
        const userInfo = await calendlyService.getUserInfo();

        try {
            const result = await User.findOrCreate({
                accessToken,
                refreshToken,
                calendlyUid: userInfo.resource.uri
            });
            cb(null, { id: result.id });
        } catch (e) {
            console.error(e);
            cb();
        }
    }
);

My implementation:

const OAuth2Strategy = require('passport-oauth2').Strategy;

const strategy = new OAuth2Strategy(
      {
        authorizationURL: CALENDLY_AUTH_BASE_URL + '/oauth/authorize',
        tokenURL: CALENDLY_AUTH_BASE_URL + '/oauth/token',
        clientID: CLIENT_ID ,
        clientSecret: CLIENT_SECRET,
        callbackURL: REDIRECT_URI,
      },
      async (accessToken, refreshToken, _profile, cb) => {
        // console.log(IArguments)
        console.log('async func called');
        console.log(accessToken, refreshToken);

        try {
          cb(null,this.getRequestConfiguration(accessToken, refreshToken));
        } catch (e) {
          console.error(e);
          cb();
        }
      }
    );

In the response I am getting undefined for accessToken, refreshToken.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!