Skip to content

Commit

Permalink
Document how to configure GitHub Enterprise as OAuth2 identity provider
Browse files Browse the repository at this point in the history
  • Loading branch information
jabellard committed Nov 20, 2023
1 parent d9538ae commit a5caf78
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,27 @@ The `CALLBACK_URL` variable is the URL that is invoked after the authorization i

The `SCOPE` variable defines the scope of the data that the OAuth provider passes on to Hoppscotch.

By default, public GitHub is used as the OAuth provider. However, an instance of Github Enterprise can also be used as the provider. To configure that, the following environment variables must be set:
- `GITHUB_AUTHORIZATION_URL`: Authorization endpoint.
- `GITHUB_TOKEN_URL`: Endpoint to retrieve access token.
- `GITHUB_USER_PROFILE_URL`: Endpoint to retrieve general user info (e.g., full name).
- `GITHUB_USER_EMAIL_URL`: Endpoint to retrieve user emails.

Sample configuration:
```yaml
# New configuration settings================================================
GITHUB_AUTHORIZATION_URL=https://{{ENTERPRISE_INSTANCE_HOST_NAME}}/#/oauth/authorize
GITHUB_TOKEN_URL=https://{{ENTERPRISE_INSTANCE_HOST_NAME}}/#/oauth/access_token
GITHUB_USER_PROFILE_URL=https:/{{ENTERPRISE_INSTANCE_HOST_NAME}}/api/v3/user
GITHUB_USER_EMAIL_URL=https://{{ENTERPRISE_INSTANCE_HOST_NAME}}/api/v3/user/emails

# Configuration settings that remain unchanged in meaning=============================
GITHUB_CLIENT_ID=*****************************************
GITHUB_CLIENT_SECRET=*****************************************
GITHUB_CALLBACK_URL=http://localhost:3170/v1/auth/github/callback
GITHUB_SCOPE="user:email"
```

The links to configure OAuth for various providers are given below:

1. [**GitHub**](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) (scope: email)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,27 @@ The `CALLBACK_URL` variable is the URL that is invoked after the authorization i

The `SCOPE` variable defines the scope of the data that the OAuth provider passes on to Hoppscotch.

By default, public GitHub is used as the OAuth provider. However, an instance of Github Enterprise can also be used as the provider. To configure that, the following environment variables must be set:
- `GITHUB_AUTHORIZATION_URL`: Authorization endpoint.
- `GITHUB_TOKEN_URL`: Endpoint to retrieve access token.
- `GITHUB_USER_PROFILE_URL`: Endpoint to retrieve general user info (e.g., full name).
- `GITHUB_USER_EMAIL_URL`: Endpoint to retrieve user emails.

Sample configuration:
```yaml
# New configuration settings================================================
GITHUB_AUTHORIZATION_URL=https://{{ENTERPRISE_INSTANCE_HOST_NAME}}/#/oauth/authorize
GITHUB_TOKEN_URL=https://{{ENTERPRISE_INSTANCE_HOST_NAME}}/#/oauth/access_token
GITHUB_USER_PROFILE_URL=https:/{{ENTERPRISE_INSTANCE_HOST_NAME}}/api/v3/user
GITHUB_USER_EMAIL_URL=https://{{ENTERPRISE_INSTANCE_HOST_NAME}}/api/v3/user/emails

# Configuration settings that remain unchanged in meaning=============================
GITHUB_CLIENT_ID=*****************************************
GITHUB_CLIENT_SECRET=*****************************************
GITHUB_CALLBACK_URL=http://localhost:3170/v1/auth/github/callback
GITHUB_SCOPE="user:email"
```

The links to configure OAuth for various providers are given below:

1. [**GitHub**](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) (scope: email)
Expand Down

0 comments on commit a5caf78

Please # to comment.