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

182
Visualizações
"POST /user/repos" does not support clientId/clientSecret basic authentication

I'm trying to create a Github Repository via an NPM package Octokit. I've set up the necessary oAuth stuff, but keep getting the same error:

HttpError: [@octokit/auth-oauth-app] "POST /user/repos" does not support clientId/clientSecret basic authentication.

import { Injectable } from '@nestjs/common';
import { Octokit } from "@octokit/rest";
import { createOAuthAppAuth } from "@octokit/auth-oauth-app";

@Injectable()
export class AppService {
  private auth() {
    return createOAuthAppAuth({
      clientType: "oauth-app",
      clientId: "xxxxxxxxxxxxxxx",
      clientSecret: "xxxxxxxxxxxxxxxxxxxxxxx",
    });
  };

  public async create() {
    const octokit = new Octokit({
      authStrategy: createOAuthAppAuth,
      auth: this.auth()
    });

    return await octokit.rest.repos.createForAuthenticatedUser({
      name: `repoName/${new Date().toString()}`
    }).then(({ data }) => { message: data });
  }

}

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

I can't thank you enough for taking the time to come back and answer your own question! I was stuck in recursive README hell going through all of the octokit repos until I found your answer 😅

about 4 years ago · Juan Pablo Isaza Relatório

0

I just needed to add a Personal Access Token rather than going to oAuth way.

const octokit = new Octokit({
  auth: "mypersonalaccesstoken123",
});

about 4 years ago · Juan Pablo Isaza Relatório
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