Skip to content

Commit

Permalink
Add environments for Github Enterprise OAuth App (#404)
Browse files Browse the repository at this point in the history
  • Loading branch information
emplam27 authored Nov 5, 2024
1 parent 516394e commit 72b0b1e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
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

# 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"),
scope: ["public_profile"],
});
}
Expand Down

0 comments on commit 72b0b1e

Please sign in to comment.