Skip to content
Open
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
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,29 @@ passport.use(new GitHubStrategy({
));
```


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, provide the relevant endpoints to that server as follows:

```javascript
passport.use(new GitHubStrategy({
clientID: GITHUB_CLIENT_ID,
clientSecret: GITHUB_CLIENT_SECRET,
authorizationURL: `https://${ENTERPRISE_INSTANCE_HOST_NAME}/login/oauth/authorize`,
tokenURL: `https://${ENTERPRISE_INSTANCE_HOST_NAME}/login/oauth/access_token`,
userProfileURL: `https://${ENTERPRISE_INSTANCE_HOST_NAME}/api/v3/user`,
userEmailURL: `https://${ENTERPRISE_INSTANCE_HOST_NAME}/api/v3/user/emails`,
callbackURL: "http://127.0.0.1:3000/auth/github/callback"
},
function(accessToken, refreshToken, profile, done) {
User.findOrCreate({ githubId: profile.id }, function (err, user) {
return done(err, user);
});
}
));
```


#### Authenticate Requests

Use `passport.authenticate()`, specifying the `'github'` strategy, to
Expand Down