Enable support for Github Enterprise when using Github Authentication
This commit is contained in:
@@ -9,6 +9,10 @@ New features:
|
|||||||
* Add config parameter to define session duration
|
* Add config parameter to define session duration
|
||||||
* Add config parameter to disable/enable RememberMe authentication
|
* Add config parameter to disable/enable RememberMe authentication
|
||||||
|
|
||||||
|
Improvements:
|
||||||
|
|
||||||
|
* Enable support for Github Enterprise when using Github Authentication
|
||||||
|
|
||||||
Bug fixes:
|
Bug fixes:
|
||||||
|
|
||||||
* Wrong template name for subtasks tooltip due to previous refactoring
|
* Wrong template name for subtasks tooltip due to previous refactoring
|
||||||
|
|||||||
@@ -94,8 +94,8 @@ class Github extends Base
|
|||||||
GITHUB_CLIENT_ID,
|
GITHUB_CLIENT_ID,
|
||||||
GITHUB_CLIENT_SECRET,
|
GITHUB_CLIENT_SECRET,
|
||||||
$this->helper->url->to('oauth', 'github', array(), '', true),
|
$this->helper->url->to('oauth', 'github', array(), '', true),
|
||||||
'https://github.com/login/oauth/authorize',
|
GITHUB_OAUTH_AUTHORIZE_URL,
|
||||||
'https://github.com/login/oauth/access_token',
|
GITHUB_OAUTH_TOKEN_URL,
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -115,7 +115,7 @@ class Github extends Base
|
|||||||
$this->getService()->getAccessToken($code);
|
$this->getService()->getAccessToken($code);
|
||||||
|
|
||||||
return $this->httpClient->getJson(
|
return $this->httpClient->getJson(
|
||||||
'https://api.github.com/user',
|
GITHUB_API_URL.'user',
|
||||||
array($this->getService()->getAuthorizationHeader())
|
array($this->getService()->getAuthorizationHeader())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,9 @@ defined('GOOGLE_CLIENT_SECRET') or define('GOOGLE_CLIENT_SECRET', '');
|
|||||||
defined('GITHUB_AUTH') or define('GITHUB_AUTH', false);
|
defined('GITHUB_AUTH') or define('GITHUB_AUTH', false);
|
||||||
defined('GITHUB_CLIENT_ID') or define('GITHUB_CLIENT_ID', '');
|
defined('GITHUB_CLIENT_ID') or define('GITHUB_CLIENT_ID', '');
|
||||||
defined('GITHUB_CLIENT_SECRET') or define('GITHUB_CLIENT_SECRET', '');
|
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
|
// Proxy authentication
|
||||||
defined('REVERSE_PROXY_AUTH') or define('REVERSE_PROXY_AUTH', false);
|
defined('REVERSE_PROXY_AUTH') or define('REVERSE_PROXY_AUTH', false);
|
||||||
|
|||||||
@@ -130,6 +130,15 @@ define('GITHUB_CLIENT_ID', '');
|
|||||||
// GitHub client secret key (Copy it from your settings -> Applications -> Developer applications)
|
// GitHub client secret key (Copy it from your settings -> Applications -> Developer applications)
|
||||||
define('GITHUB_CLIENT_SECRET', '');
|
define('GITHUB_CLIENT_SECRET', '');
|
||||||
|
|
||||||
|
// Github oauth2 authorize url
|
||||||
|
define('GITHUB_OAUTH_AUTHORIZE_URL', 'https://github.com/login/oauth/authorize');
|
||||||
|
|
||||||
|
// Github oauth2 token url
|
||||||
|
define('GITHUB_OAUTH_TOKEN_URL', 'https://github.com/login/oauth/access_token');
|
||||||
|
|
||||||
|
// Github API url (don't forget the slash at the end)
|
||||||
|
define('GITHUB_API_URL', 'https://api.github.com/');
|
||||||
|
|
||||||
// Enable/disable the reverse proxy authentication
|
// Enable/disable the reverse proxy authentication
|
||||||
define('REVERSE_PROXY_AUTH', false);
|
define('REVERSE_PROXY_AUTH', false);
|
||||||
|
|
||||||
|
|||||||
@@ -116,3 +116,4 @@ Please note
|
|||||||
|
|
||||||
Port is being hosted on [bitbucket](https://bitbucket.org/if0/freebsd-kanboard/). Feel free to comment,
|
Port is being hosted on [bitbucket](https://bitbucket.org/if0/freebsd-kanboard/). Feel free to comment,
|
||||||
fork and suggest updates!
|
fork and suggest updates!
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ How does this work?
|
|||||||
|
|
||||||
The Github authentication in Kanboard uses the [OAuth 2.0](http://oauth.net/2/) protocol, so any user of Kanboard can be linked to a Github account.
|
The Github authentication in Kanboard uses the [OAuth 2.0](http://oauth.net/2/) protocol, so any user of Kanboard can be linked to a Github account.
|
||||||
|
|
||||||
When that is done, they no longer need to manually login with their Kanboard account, but can simply automatically login with their Github account.
|
That means you can use your Github account to connect to Kanboard.
|
||||||
|
|
||||||
How to link a Github account
|
How to link a Github account
|
||||||
----------------------------
|
----------------------------
|
||||||
@@ -51,6 +51,23 @@ define('GITHUB_CLIENT_ID', 'YOUR_GITHUB_CLIENT_ID');
|
|||||||
define('GITHUB_CLIENT_SECRET', 'YOUR_GITHUB_CLIENT_SECRET');
|
define('GITHUB_CLIENT_SECRET', 'YOUR_GITHUB_CLIENT_SECRET');
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Github Entreprise
|
||||||
|
|
||||||
|
To use this authentication method with Github Enterprise you have to change the default urls.
|
||||||
|
|
||||||
|
Replace these values by your self-hosted instance of Github:
|
||||||
|
|
||||||
|
```php
|
||||||
|
// Github oauth2 authorize url
|
||||||
|
define('GITHUB_OAUTH_AUTHORIZE_URL', 'https://github.com/login/oauth/authorize');
|
||||||
|
|
||||||
|
// Github oauth2 token url
|
||||||
|
define('GITHUB_OAUTH_TOKEN_URL', 'https://github.com/login/oauth/access_token');
|
||||||
|
|
||||||
|
// Github API url (don't forget the slash at the end)
|
||||||
|
define('GITHUB_API_URL', 'https://api.github.com/');
|
||||||
|
```
|
||||||
|
|
||||||
Notes
|
Notes
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user