caffeinehit/django-oauth2-provider — pull request #65 by sema (2014-01-23 09:19:26+00:00)
Title: Add support for an Google OAUTH2 API inspired approval_prompt parameter.

This adds support foro the `approval_prompt` parameter supported in the Google OAUTH2 API.

See https://developers.google.com/accounts/docs/OAuth2WebServer#formingtheurl

In short, this parameter is now supported in authorization requests (4.1.1). The `approval_prompt` can be set to `force` (default) or `auto`. If auto is used, then it will automatically bypass the approval prompt if the client already has a valid authorization code for the current user and scope. Redirecting to the client immediately with a grant without interaction from the user.

Essentially, this enables the OAUTH API to be used as an authentication service, such that the user can log in using the OAUTH API without re-granting the same access rights each and every time.

By default, this this feature is disabled. Enable it by setting OAUTH_ENABLE_APPROVAL_PROMPT_BYPASS = true in the settings. This change is backwards compatible with the existing API and behaviour.

Tests and documentation included in the pull request.