mitsuhiko/flask-oauth — pull request #17 by djt (2011-11-17 14:18:07+00:00)
Title: Add deeper OAuth 2 token support, along with access_token parameters to allow more providers to work

OAuth 2 support seemed aimed only toward Facebook so I made some changes to make it easier to support other providers. The new provider I tested with was Google, but I can confirm that my changes have not caused any problems with Twitter or Facebook support.

*access_token_params*
This was needed by Google so that the request could include { 'grant_type': 'authorization_code' }. Without this the authentication failed.

*Force access_token with requests when there is no secret*
This seems a little unclean to me, but it was the only way I could think to get it working. Because the python-oauth library does not seem to support OAuth2, the access_token key is not added to requests (it is only added with the key oauth_token). To get around this I simply check if a secret exists, if not I assume that the request is for oauth2 and add the access_token key to the request data dict.

My testing on this has been limited, but I have not had any problems as yet.