def token(): provider = AdverbAuthorizationProvider() data = {k: request.form[k] for k in request.form.iterkeys()} response = provider.get_token_from_post_data(data) flask_res = make_response(response.text, response.status_code) for k, v in response.headers.iteritems(): flask_res.headers[k] = v return flask_res
def authorization_code(): provider = AdverbAuthorizationProvider() if not provider.validate_access(): client_id = request.args.get('client_id') return redirect(url_for('.login_get', client_id=client_id)) response = provider.get_authorization_code_from_uri(request.url) flask_res = make_response(response.text, response.status_code) for k, v in response.headers.iteritems(): flask_res.headers[k] = v return flask_res