Fail if the response type is not properly set

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
pull/9517/head
Roeland Jago Douma 7 years ago
parent 49795d2006
commit 4e3aef22a1
No known key found for this signature in database
GPG Key ID: F941078878347C0C
  1. 11
      apps/oauth2/lib/Controller/LoginRedirectorController.php

@ -61,11 +61,20 @@ class LoginRedirectorController extends Controller {
*
* @param string $client_id
* @param string $state
* @param string $response_type
* @return RedirectResponse
*/
public function authorize($client_id,
$state) {
$state,
$response_type) {
$client = $this->clientMapper->getByIdentifier($client_id);
if ($response_type !== 'code') {
//Fail
$url = $client->getRedirectUri() . '?error=unsupported_response_type&state=' . $state;
return new RedirectResponse($url);
}
$this->session->set('oauth.state', $state);
$targetUrl = $this->urlGenerator->linkToRouteAbsolute(

Loading…
Cancel
Save