Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Envs for Github Enterprise Oauth App #404

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions backend/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ GITHUB_CLIENT_SECRET=your_github_client_secret_here
# Format: https://<backend_url>/auth/login/github
# Example: http://localhost:3000/auth/login/github (For development mode)
GITHUB_CALLBACK_URL=http://localhost:3000/auth/login/github
# GITHUB_AUTHORIZATION_URL: Authorization URL for Github OAuth app.
# Default OAuth app is Github. Change this url for using Github Enterprise OAuth App.
# Format: https://ENTERPRISE_INSTANCE_URL/login/oauth/authorize
GITHUB_AUTHORIZATION_URL=https://github.com/login/oauth/authorize
# GITHUB_TOKEN_URL: Token URL for Github OAuth app.
# Default OAuth app is Github. Change this url for using Github Enterprise OAuth App.
# https://ENTERPRISE_INSTANCE_URL/login/oauth/access_token
GITHUB_TOKEN_URL=https://github.com/login/oauth/access_token
# GITHUB_USER_PROFILE_URL: User profile URL for Github OAuth app.
# Default OAuth app is Github. Change this url for using Github Enterprise OAuth App.
# https://ENTERPRISE_INSTANCE_URL/api/v3/user
GITHUB_USER_PROFILE_URL=https://api.github.com/user
devleejb marked this conversation as resolved.
Show resolved Hide resolved

# JWT_ACCESS_TOKEN_SECRET: Secret key for signing and verifying access tokens.
# JWT_ACCESS_TOKEN_EXPIRATION_TIME: Expiration time for access tokens in seconds.
Expand Down
3 changes: 3 additions & 0 deletions backend/src/auth/github.strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export class GithubStrategy extends PassportStrategy(Strategy, "github") {
clientID: configService.get<string>("GITHUB_CLIENT_ID"),
clientSecret: configService.get<string>("GITHUB_CLIENT_SECRET"),
callbackURL: configService.get<string>("GITHUB_CALLBACK_URL"),
authorizationURL: configService.get<string>("GITHUB_AUTHORIZATION_URL"),
tokenURL: configService.get<string>("GITHUB_TOKEN_URL"),
userProfileURL: configService.get<string>("GITHUB_USER_PROFILE_URL"),
devleejb marked this conversation as resolved.
Show resolved Hide resolved
scope: ["public_profile"],
});
}
Expand Down