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

318
Vistas
Cannot connect to Github account using octokit

I fail to connect to GitHub and get my account credential using the "octokit" gem.

client = Octokit::Client.new(
    client_id: ENV['GITHUB_CLIENT_ID'],
    client_secret: ENV['GITHUB_CLIENT_SECRET'],
 )

Gem File:

ruby '2.7.2'
gem 'rails', '~> 6.1.4', '>= 6.1.4.3'
gem "octokit", "~> 4.0"

Error message: Octokit::Unauthorized (GET https://api.github.com/user: 401 - Requires authentication // See: https://docs.github.com/rest/reference/users#get-the-authenticated-user)

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I had the same problem. I solved problem just like this:

client.user(ENV['GITHUB_LOGIN'], :headers => { "X-GitHub-OTP" => "2fa-token"})

If you don't have an ENV['GITHUB_LOGIN'], just type Github username

client.user('codescaptain', :headers => { "X-GitHub-OTP" => "2fa-token"})
over 4 years ago · Santiago Trujillo Denunciar
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