Skip to content

Commit

Permalink
Merge pull request #325 from djmitche/token_generator_fix
Browse files Browse the repository at this point in the history
Fix documentation for token_generator signature
  • Loading branch information
thedrow committed Jul 19, 2015
2 parents 3df94af + db12b04 commit 311b57c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/oauth2/preconfigured_servers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ Construction is simple, only import your validator and you are good to go::

If you prefer to construct tokens yourself you may pass a token generator::

def your_token_generator(request):
def your_token_generator(request, refresh_token=False):
return 'a_custom_token' + request.client_id

server = WebApplicationServer(your_validator, token_generator=your_token_generator)

This function is passed the request object and a boolean indicating whether to generate an access token (False) or a refresh token (True).

.. autoclass:: oauthlib.oauth2.WebApplicationServer
:members:

Expand Down

0 comments on commit 311b57c

Please sign in to comment.