Finally figure out what the data field is supposed to be for and use it to implement and fix 3LO.

This commit is contained in:
jakedt 2014-03-25 12:42:40 -04:00
parent e92cf37583
commit cbc40588cb
4 changed files with 33 additions and 7 deletions

View file

@ -331,3 +331,17 @@ def request_authorization_code():
return provider.get_token_response(response_type, client_id, redirect_uri, scope=scope)
else:
return provider.get_authorization_code(response_type, client_id, redirect_uri, scope=scope)
@web.route('/oauth/access_token', methods=['POST'])
@no_cache
def exchange_code_for_token():
grant_type = request.form.get('grant_type', None)
client_id = request.form.get('client_id', None)
client_secret = request.form.get('client_secret', None)
redirect_uri = request.form.get('redirect_uri', None)
code = request.form.get('code', None)
scope = request.form.get('scope', None)
provider = FlaskAuthorizationProvider()
return provider.get_token(grant_type, client_id, client_secret, redirect_uri, code, scope=scope)