mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2026-10-22 04:32:02 +02:00
Restrict access using Github collaborators (#497)
* Allow access based on Github repository
This commit is contained in:
+14
-1
@@ -101,11 +101,24 @@ Note: When using the Azure Auth provider with nginx and the cookie session store
|
||||
1. Create a new project: https://github.com/settings/developers
|
||||
2. Under `Authorization callback URL` enter the correct url ie `https://internal.yourcompany.com/oauth2/callback`
|
||||
|
||||
The GitHub auth provider supports two additional parameters to restrict authentication to Organization or Team level access. Restricting by org and team is normally accompanied with `--email-domain=*`
|
||||
The GitHub auth provider supports two additional ways to restrict authentication to either organization and optional team level access, or to collaborators of a repository. Restricting by these options is normally accompanied with `--email-domain=*`
|
||||
|
||||
To restrict by organization only, include the following flag:
|
||||
|
||||
-github-org="": restrict logins to members of this organisation
|
||||
|
||||
To restrict within an organization to specific teams, include the following flag in addition to `-github-org`:
|
||||
|
||||
-github-team="": restrict logins to members of any of these teams (slug), separated by a comma
|
||||
|
||||
If you would rather restrict access to collaborators of a repository, those users must either have push access to a public repository or any access to a private repository:
|
||||
|
||||
-github-repo="": restrict logins to collaborators of this repository formatted as orgname/repo
|
||||
|
||||
If you'd like to allow access to users with **read only** access to a **public** repository you will need to provide a [token](https://github.com/settings/tokens) for a user that has write access to the repository. The token must be created with at least the `public_repo` scope:
|
||||
|
||||
-github-token="": the token to use when verifying repository collaborators
|
||||
|
||||
If you are using GitHub enterprise, make sure you set the following to the appropriate url:
|
||||
|
||||
-login-url="http(s)://<enterprise github host>/login/oauth/authorize"
|
||||
|
||||
@@ -54,6 +54,8 @@ An example [oauth2-proxy.cfg]({{ site.gitweb }}/contrib/oauth2-proxy.cfg.example
|
||||
| `--gcp-healthchecks` | bool | will enable `/liveness_check`, `/readiness_check`, and `/` (with the proper user-agent) endpoints that will make it work well with GCP App Engine and GKE Ingresses | false |
|
||||
| `--github-org` | string | restrict logins to members of this organisation | |
|
||||
| `--github-team` | string | restrict logins to members of any of these teams (slug), separated by a comma | |
|
||||
| `--github-repo` | string | restrict logins to collaborators of this repository formatted as `orgname/repo` | |
|
||||
| `--github-token` | string | the token to use when verifying repository collaborators (must have push access to the repository) | |
|
||||
| `--gitlab-group` | string | restrict logins to members of any of these groups (slug), separated by a comma | |
|
||||
| `--google-admin-email` | string | the google admin to impersonate for api calls | |
|
||||
| `--google-group` | string | restrict logins to members of this google group (may be given multiple times). | |
|
||||
|
||||
Reference in New Issue
Block a user