Skip to content
Permalink
Browse files

Merge remote-tracking branch 'origin/master'

  • Loading branch information
jaredhanson committed May 25, 2019
2 parents c5db1b9 + f9310c7 commit 46b96e8ad4af7a3f30532316ab2ce6cc36316ed2
Showing with 24 additions and 0 deletions.
  1. +24 −0 README.md
@@ -57,6 +57,30 @@ passport.use(new GitHubStrategy({
));
```

#### Enterprise (Corporate) GitHub

To make it work with Enterprise GitHub instances you need to
pass in 3 additional parameters: `authorizationURL`, `tokenURL`, and `userProfileURL`.

```js
var GitHubStrategy = require('passport-github').Strategy;
passport.use(new GitHubStrategy({
clientID: GITHUB_CLIENT_ID,
clientSecret: GITHUB_CLIENT_SECRET,
authorizationURL: "https://ENTERPRISE_INSTANCE_URL/login/oauth/authorize",
tokenURL: "https://ENTERPRISE_INSTANCE_URL/login/oauth/access_token",
userProfileURL: "https://ENTERPRISE_INSTANCE_URL/api/v3/user",
callbackURL: "http://127.0.0.1:3000/auth/github/callback"
},
function(accessToken, refreshToken, profile, cb) {
User.findOrCreate({ githubId: profile.id }, function (err, user) {
return cb(err, user);
});
}
));
```

#### Authenticate Requests

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

0 comments on commit 46b96e8

Please sign in to comment.