summaryrefslogtreecommitdiff
path: root/doc/api/oauth2.md
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-11-10 15:16:33 +0000
committerLin Jen-Shin <godfat@godfat.org>2016-11-10 15:16:33 +0000
commit42e252da421bd11fd249897d7e7315c18910f0e9 (patch)
treec34e9b7a6a5dcd3a43b4e3aae347b7832a4b331a /doc/api/oauth2.md
parentc3508851bff289fdaaa114298b3ae13513646775 (diff)
parent87cc458a22e0cf91ca5ffe5b988077ec41e59404 (diff)
downloadgitlab-ce-42e252da421bd11fd249897d7e7315c18910f0e9.tar.gz
Merge remote-tracking branch 'upstream/master' into feature/1376-allow-write-access-deploy-keys
* upstream/master: (3852 commits) Grapify token API Fix cache for commit status in commits list to respect branches Grapify milestones API Grapify runners API Improve EeCompatCheck, cache EE repo and keep artifacts for the ee_compat_check task Use 'Forking in progress' title when appropriate Fix CHANGELOG after 8.14.0-rc1 tag Update CHANGELOG.md for 8.14.0-rc1 Fix YAML syntax on CHANGELOG entry Remove redundant rescue from repository keep_around Remove redundant space from repository model code Remove order-dependent expectation Minor CHANGELOG.md cleanups Add a link to Git cheatsheet PDF in docs readme Grapify the session API Add 8.13.5, 8.12.9, and 8.11.11 CHANGELOG Merge branch 'unauthenticated-container-registry-access' into 'security' Merge branch '23403-fix-events-for-private-project-features' into 'security' Merge branch 'fix-unathorized-cloning' into 'security' Merge branch 'markdown-xss-fix-option-2.1' into 'security' ...
Diffstat (limited to 'doc/api/oauth2.md')
-rw-r--r--doc/api/oauth2.md26
1 files changed, 13 insertions, 13 deletions
diff --git a/doc/api/oauth2.md b/doc/api/oauth2.md
index 16ef79617c0..5ef5e3f5744 100644
--- a/doc/api/oauth2.md
+++ b/doc/api/oauth2.md
@@ -1,10 +1,10 @@
-# GitLab as an OAuth2 client
+# GitLab as an OAuth2 provider
This document covers using the OAuth2 protocol to access GitLab.
If you want GitLab to be an OAuth authentication service provider to sign into other services please see the [Oauth2 provider documentation](../integration/oauth_provider.md).
-OAuth2 is a protocol that enables us to authenticate a user without requiring them to give their password to a third-party.
+OAuth2 is a protocol that enables us to authenticate a user without requiring them to give their password to a third-party.
This functionality is based on [doorkeeper gem](https://github.com/doorkeeper-gem/doorkeeper)
@@ -22,7 +22,7 @@ In the following sections you will be introduced to the three steps needed for t
### 1. Registering the client
First, you should create an application (`/profile/applications`) in your user's account.
-Each application gets a unique App ID and App Secret parameters.
+Each application gets a unique App ID and App Secret parameters.
>**Note:**
**You should not share/leak your App ID or App Secret.**
@@ -46,10 +46,10 @@ http://myapp.com/oauth/redirect?code=1234567890&state=your_unique_state_hash
You should then use the `code` to request an access token.
>**Important:**
-It is highly recommended that you send a `state` value with the request to `/oauth/authorize` and
-validate that value is returned and matches in the redirect request.
-This is important to prevent [CSFR attacks](http://www.oauthsecurity.com/#user-content-authorization-code-flow),
-`state` really should have been a requirement in the standard!
+It is highly recommended that you send a `state` value with the request to `/oauth/authorize` and
+validate that value is returned and matches in the redirect request.
+This is important to prevent [CSRF attacks](http://www.oauthsecurity.com/#user-content-authorization-code-flow),
+`state` really should have been a requirement in the standard!
### 3. Requesting the access token
@@ -62,7 +62,7 @@ RestClient.post 'http://localhost:3000/oauth/token', parameters
# The response will be
{
"access_token": "de6780bc506a0446309bd9362820ba8aed28aa506c71eedbe1c5c4f9dd350e54",
- "token_type": "bearer",
+ "token_type": "bearer",
"expires_in": 7200,
"refresh_token": "8257e65c97202ed1726cf9571600918f3bffb2544b26e00a61df9897668c33a1"
}
@@ -90,12 +90,12 @@ curl --header "Authorization: Bearer OAUTH-TOKEN" https://localhost:3000/api/v3/
## Deprecation Notice
-1. Starting in GitLab 9.0, the Resource Owner Password Credentials will be *disabled* for users with two-factor authentication turned on.
+1. Starting in GitLab 8.11, the Resource Owner Password Credentials has been *disabled* for users with two-factor authentication turned on.
2. These users can access the API using [personal access tokens] instead.
---
-In this flow, a token is requested in exchange for the resource owner credentials (username and password).
+In this flow, a token is requested in exchange for the resource owner credentials (username and password).
The credentials should only be used when there is a high degree of trust between the resource owner and the client (e.g. the
client is part of the device operating system or a highly privileged application), and when other authorization grant types are not
available (such as an authorization code).
@@ -112,7 +112,7 @@ You can do POST request to `/oauth/token` with parameters:
{
"grant_type" : "password",
"username" : "user@example.com",
- "password" : "sekret"
+ "password" : "secret"
}
```
@@ -130,8 +130,8 @@ For testing you can use the oauth2 ruby gem:
```
client = OAuth2::Client.new('the_client_id', 'the_client_secret', :site => "http://example.com")
-access_token = client.password.get_token('user@example.com', 'sekret')
+access_token = client.password.get_token('user@example.com', 'secret')
puts access_token.token
```
-[personal access tokens]: ./README.md#personal-access-tokens
+[personal access tokens]: ./README.md#personal-access-tokens \ No newline at end of file