Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

201
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda