Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I get a Github access token limited to access a single organization?

Tags:

github-api

I need access to a private repository in an organization through the github api.

I use my Personal access token, but it provides access to my private repos which I don't want it to have.

Is it possible to create an access token with access to only one organization, not all my private repositories?

like image 703
Unlink Avatar asked Jun 27 '15 18:06

Unlink


People also ask

Can you have multiple access tokens?

Access tokens are generated for an application, not a user, but yes, there can be multiple access tokens authorized by a single user - the user authorizes the application to perform some operations (scopes) on his behalf.

Why do I need a personal access token GitHub?

Personal access token are an alternative to using passwords for authentication to GitHub Enterprise Server when using the GitHub API or the command line. Personal access tokens are intended to access GitHub resources on behalf of yourself.

Do GitHub Personal access tokens expire?

Your tokens can expire and can also be revoked by you, applications you have authorized, and GitHub itself. When a token has expired or has been revoked, it can no longer be used to authenticate Git and API requests.


1 Answers

Yes, this is possible. Create a separate Github account and add it to the Owners team only on the single Organization you want access to. Get and use its access token.

The token will also have admin access to the other account, but that may be acceptable for your needs.

like image 168
Alain O'Dea Avatar answered Sep 20 '22 22:09

Alain O'Dea