Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

505
Vistas
Twitter api returns unsupported authentication; "detail": "Authenticating with Unknown is forbidden for this endpoint."

I am trying to send a https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-id api to obtain some user info, but the response is always

{
  statusCode: 403,
  data: '{\n' +
    '  "title": "Unsupported Authentication",\n' +
    '  "detail": "Authenticating with Unknown is forbidden for this endpoint.  Supported authentication types are [OAuth 1.0a User Context, OAuth 2.0 Application-Only, OAuth 2.0 User Context].",\n' +
    '  "type": "https://api.twitter.com/2/problems/unsupported-authentication",\n' +
    '  "status": 403\n' +
    '}'
}

Even though I have successfully have the oauth_access_token and oauth_access_secret as described in https://developer.twitter.com/en/docs/authentication/oauth-1-0a/obtaining-user-access-tokens Below is my code snippet to send the request;

// server.js
app.get('/api/twitter/temp/profile', async (req, res) =>{
  const { oauth_access_token, oauth_access_token_secret } = access_tokens[tmp_token]; 
  try {
    // const ids = req.query.ids.join()
    const ids = req.query.ids
    console.log("ids "+ids)
    console.log(oauth_access_token, oauth_access_token_secret)
    const response = await oauth.sendRequest({
      method: 'get',
      url: `https://api.twitter.com/2/users?ids=${ids}`,
      oauth_access_token,
      oauth_access_token_secret
    })
    console,log(response)
    res.json({message: 'ok'})
  } catch (error) {
    console.log(error)
  }
})

The library that I used to send the request to twitter (taking care of headers etc) is https://github.com/ciaranj/node-oauth/blob/a7f8a1e21c362eb4ed2039431fb9ac2ae749f26a/lib/oauth.js#L486, so the oauth in my server.js is a wrapper of that library etc.

about 4 years ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda