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

200
Views
Citrix ShareFile API token issue

I am having some trouble with a Citrix ShareFile API. Right now we've got two environments. The first one I am able get the token and make calls without issue, the second is a new POC environment we are testing, I have basically copied my code, updated my environment variables with new API key and secret, etc and cannot get an access token.

Whenever I run my script to get an access token I get a 200 response but get the message "Error retrieving Microsoft Graph Access Token." I am having a hard time finding the issue, whether it's in my code or somewhere else

Here is my code if this helps at all

let secrets;
let errorCallback;

const getAccessToken = async () => {
    try {
        const getAccessTokenRequest = {
            url: `https://${subDomain}.sharefile.com/oauth/token`,
            method: "POST",
            headers: {
                "Content-Type": "application/x-www-form-urlencoded"
            },
            data: `grant_type=password&client_id=${clientId}&client_secret=${clientSecret}&username=${userName}&password=${password}`
        };
        const response = await axios(getAccessTokenRequest);
        const accessToken = (((response || {}).data || {}).access_token || null);
        return accessToken ? accessToken : console.log(`Error retrieving Microsoft Graph Access Token.`);
    } catch (err) {
        console.log(`Error retrieving Citrix Sharefile Access Token. Error: ${err}`);
    }
};

module.exports = async (input, callback, error) => {
    try {
        secrets = input.secrets;
        errorCallback = error;
        let request = input.request;
        const accessToken = await getAccessToken();
        request.headers.Authorization = `Bearer ${accessToken}`;
        callback(request);
    } catch (err) {
        error(err);
    }
};
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!