From 1acad14c9e27c652bcb9bf42e6db38fa62b2fb9f Mon Sep 17 00:00:00 2001 From: Alex Warren Date: Thu, 27 Aug 2015 13:55:10 +0000 Subject: [PATCH] Correct grant_type in example --- doc/api/oauth2.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/oauth2.md b/doc/api/oauth2.md index d416a826f7..606bbebd60 100644 --- a/doc/api/oauth2.md +++ b/doc/api/oauth2.md @@ -35,7 +35,7 @@ Where REDIRECT_URI is the URL in your app where users will be sent after authori To request the access token, you should use the returned code and exchange it for an access token. To do that you can use any HTTP client. In this case, I used rest-client: ``` -parameters = 'client_id=APP_ID&client_secret=APP_SECRET&code=RETURNED_CODE&grant_type=AUTHORIZATION_CODE&redirect_uri=REDIRECT_URI' +parameters = 'client_id=APP_ID&client_secret=APP_SECRET&code=RETURNED_CODE&grant_type=authorization_code&redirect_uri=REDIRECT_URI' RestClient.post 'http://localhost:3000/oauth/token', parameters # The response will be @@ -99,4 +99,4 @@ 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') puts access_token.token -``` +``` \ No newline at end of file