Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 4

Unable to create a repository using installed GitHub app

I'm trying to create a repo on behalf of user who installed the Github App. I followed the steps here 

https://developer.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-...

I'm stuck on step 2 once where the code is exchanged for access_token.

 

When I try to post to this URL https://github.com/login/oauth/access_token with the code, I'm getting the 404 "Not Found" response.

 

Am I doing something wrong, isn't possible to create and manage repos by Github App?

3 Replies
Community Manager
Message 2 of 4

Re: Unable to create a repository using installed GitHub app

Yes, it is possible to create repositories via a GitHub App. Unfortunately, you're not even getting to that part. It appears that you're getting stuck on the OAuth-like process for user-to-server access.

 

  1. If you supplied a `state` string in Step 1, did you supply that same `state` string in Step 2?
  2. Did you pass the code, the client ID, and client secret in step 2?
  3. Did you select Request user authorization (OAuth) during installation when creating or modifying your app?

 

Let us know.

Copilot Lvl 2
Message 3 of 4

Re: Unable to create a repository using installed GitHub app

  1. N/A - "Request user authorization (OAuth) during installation" is used
  2. Yes
  3. Yes

 

Suprisingly, this worked today, unsure why it didn't work before.

Community Manager
Message 4 of 4

Re: Unable to create a repository using installed GitHub app

Glad to hear that it is working for you now 😀 Let us know if you have more questions.