From d015be6057d02925aa33e84a4eb9b82a742b9145 Mon Sep 17 00:00:00 2001 From: Martin Walsh Date: Tue, 5 Dec 2017 11:07:05 +0000 Subject: [PATCH 1/2] Utilise Auth0->Login to ensure state validation Update auth0-PHP dependency --- composer.json | 2 +- src/Auth0/Login/Auth0Service.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 322a56e4..d5b8b8f2 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "require": { "php": ">=5.3.0", "illuminate/support": "5.*", - "auth0/auth0-php": "^5.0.0", + "auth0/auth0-php": "^5.1.0", "illuminate/contracts": "5.*" }, "autoload": { diff --git a/src/Auth0/Login/Auth0Service.php b/src/Auth0/Login/Auth0Service.php index 5d0c0658..fe596fe9 100644 --- a/src/Auth0/Login/Auth0Service.php +++ b/src/Auth0/Login/Auth0Service.php @@ -53,8 +53,8 @@ public function logout() */ public function login($connection = null, $state = null, $aditional_params = ['scope' => 'openid profile email'], $response_type = 'code') { - $url = $this->authApi->get_authorize_link($response_type, $this->auth0Config['redirect_uri'], $connection, $state, $aditional_params); - return \Redirect::to($url); + $this->auth0->response_type = $response_type; + $this->auth0->login($state, $connection, $additional_params); } /** From cfad9875c54b743814d856cc7637b411b160acd8 Mon Sep 17 00:00:00 2001 From: Josh Cunningham Date: Fri, 2 Mar 2018 12:57:04 -0800 Subject: [PATCH 2/2] don't use protected response_type param; correct additional_params spelling in function signature --- src/Auth0/Login/Auth0Service.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Auth0/Login/Auth0Service.php b/src/Auth0/Login/Auth0Service.php index fe596fe9..87c11e38 100644 --- a/src/Auth0/Login/Auth0Service.php +++ b/src/Auth0/Login/Auth0Service.php @@ -51,9 +51,9 @@ public function logout() /** * Redirects the user to the hosted login page */ - public function login($connection = null, $state = null, $aditional_params = ['scope' => 'openid profile email'], $response_type = 'code') + public function login($connection = null, $state = null, $additional_params = ['scope' => 'openid profile email'], $response_type = 'code') { - $this->auth0->response_type = $response_type; + $additional_params['response_type'] = $response_type; $this->auth0->login($state, $connection, $additional_params); }