Display OAuth2 urls on integration page and update doc

This commit is contained in:
Frederic Guillot 2015-07-16 20:58:22 -04:00
parent ede1f1d9b0
commit 94068019db
4 changed files with 90 additions and 80 deletions

View File

@ -6,6 +6,18 @@
<?= $this->form->csrf() ?>
<h3><i class="fa fa-google"></i> <?= t('Google Authentication') ?></h3>
<div class="listing">
<input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->href('oauth', 'google', array(), false, '', true) ?>"/><br/>
<p class="form-help"><a href="http://kanboard.net/documentation/google-authentication" target="_blank"><?= t('Help on Google authentication') ?></a></p>
</div>
<h3><i class="fa fa-github"></i> <?= t('Github Authentication') ?></h3>
<div class="listing">
<input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->href('oauth', 'github', array(), false, '', true) ?>"/><br/>
<p class="form-help"><a href="http://kanboard.net/documentation/github-authentication" target="_blank"><?= t('Help on Github authentication') ?></a></p>
</div>
<h3><img src="<?= $this->url->dir() ?>assets/img/mailgun-icon.png"/>&nbsp;<?= t('Mailgun (incoming emails)') ?></h3>
<div class="listing">
<input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->href('webhook', 'mailgun', array('token' => $values['webhook_token']), false, '', true) ?>"/><br/>

View File

@ -1,64 +1,63 @@
GitHub Authentication
=====================
Requirements
------------
- OAuth GitHub API credentials (available in your [Settings > Applications > Developer applications](https://github.com/settings/applications))
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.
When that is done, they no longer need to manually login with their Kanboard account, but can simply automatically login with their GitHub account.
How to link a GitHub account
----------------------------------
1. Login to Kanboard with the desired user
2. Go to the **Edit user** page and click on the link **Link my GitHub Account**
3. You are redirected to the GitHub **Authorize application** form, authorize Kanboard by clicking on the button **Accept**
4. Finally, you are redirected to Kanboard and now your user account is linked to your GitHub account
5. During the process, Kanboard has updated your full name and your email address based on your GitHub profile, if either of those are publically available
6. Log out of Kanboard and you should be able to login directly with GitHub by clicking on the link **Login with my GitHub Account**
Installation instructions
-------------------------
### Setting up OAuth 2.0
On Github, go to the page ["Register a new OAuth application"](https://github.com/settings/applications/new).
Just follow the [official GitHub documentation](https://developer.github.com/guides/basics-of-authentication/#registering-your-app):
- Open your [Settings](https://github.com/settings), select [Applications](https://github.com/settings/applications) from the sidebar and click on [Register new application](https://github.com/settings/applications/new) on the top, next to where it says **Developer applications**
- Fill out the form with whatever values you like, the **Authorization callback URL** _must_ be: **http://YOUR_SERVER/?controller=user&action=gitHub**
### Setting up Kanboard
Either create a new `config.php` file or rename the `config.default.php` file and set the following values:
```php
// Enable/disable GitHub authentication
define('GITHUB_AUTH', true);
// GitHub client id (Copy it from your settings -> Applications -> Developer applications)
define('GITHUB_CLIENT_ID', 'YOUR_GITHUB_CLIENT_ID');
// GitHub client secret key (Copy it from your settings -> Applications -> Developer applications)
define('GITHUB_CLIENT_SECRET', 'YOUR_GITHUB_CLIENT_SECRET');
```
Notes
-----
**Important:** _*Never*_ store your GITHUB_CLIENT_ID or GITHUB_CLIENT_SECRET in GitHub or somewhere with full public access in general!
Kanboard uses these information from your public GitHub profile:
- Full name
- Public email address
- GitHub unique id
The GitHub unique id is used to link the local user account and the GitHub account.
Github Authentication
=====================
Requirements
------------
OAuth Github API credentials (available in your [Settings > Applications > Developer applications](https://github.com/settings/applications))
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.
When that is done, they no longer need to manually login with their Kanboard account, but can simply automatically login with their Github account.
How to link a Github account
----------------------------
1. Go to your user profile
2. Click on **External accounts**
3. Click on the link **Link my Github Account**
4. You are redirected to the **Github Authorize application form**
5. Authorize Kanboard by clicking on the button **Accept**
6. Your account is now linked
Now, on the login page you can be authenticated in one click with the link **Login with my Github Account**.
Your name and email are automatically updated from your Github Account if defined.
Installation instructions
-------------------------
### Setting up OAuth 2.0
- On Github, go to the page [Register a new OAuth application](https://github.com/settings/applications/new)
- Just follow the [official Github documentation](https://developer.github.com/guides/basics-of-authentication/#registering-your-app)
- In Kanboard, you can get the **callback url** in **Settings > Integrations > Github Authentication**
### Setting up Kanboard
Either create a new `config.php` file or rename the `config.default.php` file and set the following values:
```php
// Enable/disable Github authentication
define('GITHUB_AUTH', true);
// Github client id (Copy it from your settings -> Applications -> Developer applications)
define('GITHUB_CLIENT_ID', 'YOUR_GITHUB_CLIENT_ID');
// Github client secret key (Copy it from your settings -> Applications -> Developer applications)
define('GITHUB_CLIENT_SECRET', 'YOUR_GITHUB_CLIENT_SECRET');
```
Notes
-----
Kanboard uses these information from your public Github profile:
- Full name
- Public email address
- Github unique id
The Github unique id is used to link the local user account and the Github account.

View File

@ -4,7 +4,7 @@ Google Authentication
Requirements
------------
- OAuth Google API credentials (available in the Google Developer Console)
OAuth Google API credentials (available in the Google Developer Console)
How does this work?
-------------------
@ -16,24 +16,24 @@ How does this work?
Procedure to link a Google Account
----------------------------------
1. The first step is to link an existing user account to a Google Account
2. Login with the desired user
3. Go to the **Edit user** page and click on the link **Link my Google Account**
4. You are redirected to the **Google Consent screen**, authorize Kanboard by clicking on the button **Accept**
5. Finally, you are redirected to Kanboard and now your user account is linked to your Google account
6. During the process, Kanboard have updated your full name and your email address based on your Google profile
7. Log out and you should be able to login directly with Google by clicking on the link **Login with my Google Account**
1. Go to your user profile
2. Click on **External accounts**
3. Click on the link **Link my Google Account**
4. You are redirected to the **Google Consent screen**
5. Authorize Kanboard by clicking on the button **Accept**
6. Your account is now linked
Now, on the login page you can be authenticated in one click with the link **Login with my Google Account**.
Your name and email are automatically updated from your Google Account.
Installation instructions
-------------------------
### Setting up OAuth 2.0
### Setting up OAuth 2.0 in Google Developer Console
Follow the [official Google documentation](https://developers.google.com/accounts/docs/OAuth2Login#appsetup), in summary:
- Go to the [Developer Console](https://console.developers.google.com)
- On the sidebar, click on **Credentials** and choose **Create a new Client Id**
- Fill the form, the redirect URL must be: **http://YOUR_SERVER/?controller=user&action=google**
- Follow the [official Google documentation](https://developers.google.com/accounts/docs/OAuth2Login#appsetup) to create a new application
- In Kanboard, you can get the **redirect url** in **Settings > Integrations > Google Authentication**
### Setting up Kanboad
@ -50,7 +50,6 @@ define('GOOGLE_CLIENT_ID', 'YOUR_CLIENT_ID');
// Google client secret key (Get this value from the Google developer console)
define('GOOGLE_CLIENT_SECRET', 'YOUR_CLIENT_SECRET');
```
Notes

View File

@ -110,7 +110,7 @@ Technical details
- [LDAP authentication](ldap-authentication.markdown)
- [Google authentication](google-authentication.markdown)
- [GitHub authentication](github-authentication.markdown)
- [Github authentication](github-authentication.markdown)
- [Reverse proxy authentication](reverse-proxy-authentication.markdown)
### Contributors