mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[PR #3568] Extend GitHub Oauth2 strategy for use with GitHub Enterprise #4431
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#4431
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/3568
Author: @jabellard
Created: 11/20/2023
Status: 🔄 Open
Base:
main← Head:feature/github_enterprise📝 Commits (1)
17351a4Expose configuration settings for use with Github Enterprise📊 Changes
1 file changed (+4 additions, -0 deletions)
View changed files
📝
packages/hoppscotch-backend/src/auth/strategies/github.strategy.ts(+4 -0)📄 Description
Description
The GitHub Oauth2 SSO strategy is built on top of the passport-github2 package. That package, by default, is configured to use public GitHub as the identity provider:
Authorization URL Setting
Token URL Setting
User Profile URL Setting
User Email URL Setting
Those defaults can be overridden so that an instance of GitHub Enterprise can be used as the identity provider.
The purpose of this PR is to enable that by setting the following environment variables:
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:
The changes introduced in this PR are completed backwards compatible. As such, if if the intent is to use public GitHub as the identity provider, nothing changes. However, to use an instance of GitHub Enterprise as the identity provider, the environment variables outlined above must be set appropriately.
Checks
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.