Created
November 10, 2011 21:14
-
-
Save slinkp/1356251 to your computer and use it in GitHub Desktop.
Hack to avoid showing a confirmation form with django-oauth-plus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def oauth_authorize_without_confirmation(request, request_token, callback_url, params): | |
| """ | |
| This version uses some hackery to pretend the user has confirmed. | |
| """ | |
| params = request.GET.copy() | |
| params['authorize_access'] = True | |
| # request.POST claims to be immutable, but of course there's a way. | |
| # Presumably I could just look up the HTTPRequest constructor... | |
| request._set_post(params) | |
| request.method = 'POST' | |
| from oauth_provider.views import user_authorization | |
| return user_authorization(request) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment