summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-08-01 16:48:58 -0400
committerFrederic Guillot <fred@kanboard.net>2015-08-01 16:48:58 -0400
commitea24cfb07c38e121613980e35aa8b1d2d65ac72c (patch)
tree5f7043baacbc93a0eda90bf9f525de5a187786f1 /app
parent80a0c9f56075bb5cc9ece781d33d15abae75ede2 (diff)
Enable support for Github Enterprise when using Github Authentication
Diffstat (limited to 'app')
-rw-r--r--app/Auth/Github.php6
-rw-r--r--app/constants.php3
2 files changed, 6 insertions, 3 deletions
diff --git a/app/Auth/Github.php b/app/Auth/Github.php
index 44bcc6c8..021ea77d 100644
--- a/app/Auth/Github.php
+++ b/app/Auth/Github.php
@@ -94,8 +94,8 @@ class Github extends Base
GITHUB_CLIENT_ID,
GITHUB_CLIENT_SECRET,
$this->helper->url->to('oauth', 'github', array(), '', true),
- 'https://github.com/login/oauth/authorize',
- 'https://github.com/login/oauth/access_token',
+ GITHUB_OAUTH_AUTHORIZE_URL,
+ GITHUB_OAUTH_TOKEN_URL,
array()
);
}
@@ -115,7 +115,7 @@ class Github extends Base
$this->getService()->getAccessToken($code);
return $this->httpClient->getJson(
- 'https://api.github.com/user',
+ GITHUB_API_URL.'user',
array($this->getService()->getAuthorizationHeader())
);
}
diff --git a/app/constants.php b/app/constants.php
index 61dfa10a..072db543 100644
--- a/app/constants.php
+++ b/app/constants.php
@@ -46,6 +46,9 @@ defined('GOOGLE_CLIENT_SECRET') or define('GOOGLE_CLIENT_SECRET', '');
defined('GITHUB_AUTH') or define('GITHUB_AUTH', false);
defined('GITHUB_CLIENT_ID') or define('GITHUB_CLIENT_ID', '');
defined('GITHUB_CLIENT_SECRET') or define('GITHUB_CLIENT_SECRET', '');
+defined('GITHUB_OAUTH_AUTHORIZE_URL') or define('GITHUB_OAUTH_AUTHORIZE_URL', 'https://github.com/login/oauth/authorize');
+defined('GITHUB_OAUTH_TOKEN_URL') or define('GITHUB_OAUTH_TOKEN_URL', 'https://github.com/login/oauth/access_token');
+defined('GITHUB_API_URL') or define('GITHUB_API_URL', 'https://api.github.com/');
// Proxy authentication
defined('REVERSE_PROXY_AUTH') or define('REVERSE_PROXY_AUTH', false);