From fa70ce1068babe592d348497c772f1b5160cbb6e Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 6 Jan 2021 19:21:00 +0000 Subject: Add latest changes from gitlab-org/security/gitlab@13-7-stable-ee --- app/controllers/oauth/authorizations_controller.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app') diff --git a/app/controllers/oauth/authorizations_controller.rb b/app/controllers/oauth/authorizations_controller.rb index 6e8686ee90b..ade698baa7f 100644 --- a/app/controllers/oauth/authorizations_controller.rb +++ b/app/controllers/oauth/authorizations_controller.rb @@ -24,6 +24,17 @@ class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController end end + def create + # Confidential apps require the client_secret to be sent with the request. + # Doorkeeper allows implicit grant flow requests (response_type=token) to + # work without client_secret regardless of the confidential setting. + if pre_auth.authorizable? && pre_auth.response_type == 'token' && pre_auth.client.application.confidential + render "doorkeeper/authorizations/error" + else + super + end + end + private def verify_confirmed_email! -- cgit v1.2.3