From edaf7d9a045fa7bd0c367365e20c3e72b1083961 Mon Sep 17 00:00:00 2001 From: Csaba Koncz Date: Sat, 10 Dec 2016 21:54:44 +0100 Subject: [PATCH] Support authentication through Github Enterprise config.yml is consulted for various Github URLs so that Jingo can connect to Github instances hosted at arbitrary locations. E.g. to login using https://mygithub.com one can add the following configuration (tested with Github Enterprise 2.6): github: enabled: true redirectURL: '' clientId: clientSecret: authorizationURL: https://mygithub.com/login/oauth/authorize tokenURL: https://mygithub.com/login/oauth/access_token userProfileURL: https://mygithub.com/api/v3/user --- routes/auth.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routes/auth.js b/routes/auth.js index c21ada08..e0d6a886 100644 --- a/routes/auth.js +++ b/routes/auth.js @@ -75,7 +75,10 @@ if (auth.github.enabled) { passport.use(new passportGithub({ // eslint-disable-line new-cap clientID: auth.github.clientId, clientSecret: auth.github.clientSecret, - callbackURL: redirectURL + callbackURL: redirectURL, + authorizationURL: auth.github.authorizationURL, + tokenURL: auth.github.tokenURL, + userProfileURL: auth.github.userProfileURL }, function (accessToken, refreshToken, profile, done) { usedAuthentication('github')