"Resource not available to integration" when trying to fetch diff as user for Github App #24506
-
I have a GitHub app using a user token trying to make the following request (through octokit):
These are my headers:
I get denied with “Resource not available to integration”. Note that this API request works perfectly without the authorization token header and my GitHub App has “Read only” access to “Contents”. What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
👋 hello there @hatboysam, and welcome to the GitHub Support Community!
hatboysam:
If those branches are in a public repository, anyone (whether authenticating or not) should be able to make a request to that endpoint. If you’re still experiencing this, could you please send us the full output of a That should help us investigate the issue. Also, please make sure you mask any sensitive information like OAuth tokens and Authorization headers in the output of the curl command. |
Beta Was this translation helpful? Give feedback.
-
@francisfuzz Here is a failing CURL request (I get 403). I got this from the Firefox inspector’s “copy as curl” from a real 403 failure so I am sure this is correct:
As you said, this works fine without the |
Beta Was this translation helpful? Give feedback.
-
@hatboysam - Thanks for sharing that Given the result of the workflow run, I’m admittedly not sure why the request you shared resulted in a 403. Here are my follow-up questions:
The more information, the better. Thanks again! 🙇♂️ |
Beta Was this translation helpful? Give feedback.
-
@francisfuzz thanks for looking into this. Here’s a request id from a failure just a moment ago:
I am able to reproduce this as a I want to mention that I am doing this request from a web app and therefore I am using a user token which I get from an OAuth flow on my server on behalf of my GitHub app.
|
Beta Was this translation helpful? Give feedback.
-
hatboysam:
@hatboysam I found that request in our logs––thanks again for sharing it with us! I’m wondering if this particular GitHub App is installed to the
Interesting! Could you also check to see if that particular user access token has access to those repositories? We have an endpoint that lists which repositories are accessible to the user access token. We’re keen to hear how you get on. 👍 |
Beta Was this translation helpful? Give feedback.
-
Ohhhh man I feel so dumb! I have two GitHub apps for this project: one for dev and one for prod. I never added the dev app to my project. Once I did that, everything worked. Thank you for your patience! |
Beta Was this translation helpful? Give feedback.
@hatboysam I found that request in our logs––thanks again for sharing it with us!
I’m wondering if this particular GitHub App is installed to the
hatboysam/diffmachine
repository? To check, you can make a request that lists the repositories accessible to the application installation. If it’s not installed, can you try installing that application to the repository and making that request again?Interesting! Could you also check to see if that particular user access to…