Merge pull request #55 from coreos-inc/oauthdeny
Fix OAuth redirect for denial action when generating for internal tokens
This commit is contained in:
commit
e09d84b3c8
5 changed files with 56 additions and 16 deletions
|
@ -417,6 +417,19 @@ def authorize_application():
|
|||
return provider.get_token_response('token', client_id, redirect_uri, scope=scope)
|
||||
|
||||
|
||||
|
||||
@web.route(app.config['LOCAL_OAUTH_HANDLER'], methods=['GET'])
|
||||
def oauth_local_handler():
|
||||
if not current_user.is_authenticated():
|
||||
abort(401)
|
||||
return
|
||||
|
||||
if not request.args.get('scope'):
|
||||
return render_page_template("message.html", message="Authorization canceled")
|
||||
else:
|
||||
return render_page_template("generatedtoken.html")
|
||||
|
||||
|
||||
@web.route('/oauth/denyapp', methods=['POST'])
|
||||
@csrf_protect
|
||||
def deny_application():
|
||||
|
@ -447,7 +460,7 @@ def request_authorization_code():
|
|||
|
||||
if (not current_user.is_authenticated() or
|
||||
not provider.validate_has_scopes(client_id, current_user.db_user().username, scope)):
|
||||
if redirect_uri != 'display' and not provider.validate_redirect_uri(client_id, redirect_uri):
|
||||
if not provider.validate_redirect_uri(client_id, redirect_uri):
|
||||
current_app = provider.get_application_for_client_id(client_id)
|
||||
if not current_app:
|
||||
abort(404)
|
||||
|
|
Reference in a new issue