Skip to content

Commit e706388

Browse files
doc-E-brownauvipy
authored andcommitted
Added documentation for using request token in Getting Started (#641)
1 parent 26a3c3e commit e706388

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/rest-framework/getting_started.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,26 @@ Grab your access_token and start using your new OAuth2 API:
189189
# Insert a new user
190190
curl -H "Authorization: Bearer <your_access_token>" -X POST -d"username=foo&password=bar" http://localhost:8000/users/
191191

192+
Some time has passed and your access token is about to expire, you can get renew the access token issued using the `refresh token`:
193+
194+
::
195+
196+
curl -X POST -d "grant_type=refresh_token&refresh_token=<your_refresh_token>&client_id=<your_client_id>&client_secret=<your_client_secret>" http://localhost:8000/o/token/
197+
198+
Your response should be similar to your first access_token request, containing a new access_token and refresh_token:
199+
200+
.. code-block:: javascript
201+
202+
{
203+
"access_token": "<your_new_access_token>",
204+
"token_type": "Bearer",
205+
"expires_in": 36000,
206+
"refresh_token": "<your_new_refresh_token>",
207+
"scope": "read write groups"
208+
}
209+
210+
211+
192212
Step 5: Testing Restricted Access
193213
---------------------------------
194214

0 commit comments

Comments
 (0)