How to restrict GitHub App Usage to Specific Users ? #142122
Replies: 2 comments 2 replies
-
Hi @Sonali-Behera-TRT , Hope you are doing well. Unfortunately, GitHub itself doesn't provide direct built-in support for restricting app usage based on custom user-defined conditions (like API keys or a list of approved users).
Adding this code to your project will solve the issue you are facing. All the best, |
Beta Was this translation helpful? Give feedback.
-
Hi @Sonali-Behera-TRT , Actually, Github does not natively support adding custom headers or query parameters in webhook requests. Webhooks from Github are fairly standardized in terms of the structure and the content. I think these Github Web hook headers and built-in fields will help you restrict app usage.
It's impossible to dynamically pass extra identifying information (like custom query parameters or headers) within the webhook request sent by Github. We will need to validate the user based on the payload which is the most viable solution. Best, |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
I'm currently beta testing a GitHub app and want to limit its usage to a specific set of users, even though multiple users may install the app on their repositories. The app uses webhook events for triggers, and I am already validating the webhook signatures using a webhook secret to ensure the authenticity of the requests.
However, I need to add an extra layer of authorization where only certain users, who I’ve shared an API key or token with, can interact with my app. The goal is to block unapproved users from using the app, even if they install it. Is it possible to implement this type of access control within the GitHub app environment, or is there a built-in GitHub feature that supports this scenario?
Any guidance or suggestions on how to set up such an authorization system while still ensuring the security and integrity of webhook requests would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions