From f0e6be835371fdb438546501fe0b98bbee5cf538 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sat, 28 Oct 2017 15:08:10 +0200 Subject: [PATCH 1/1] Support auth servers with ? in their URL Resolves: https://github.com/cweiske/shpub/issues/10 --- src/shpub/Command/Connect.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/shpub/Command/Connect.php b/src/shpub/Command/Connect.php index e920777..6ac5ed4 100644 --- a/src/shpub/Command/Connect.php +++ b/src/shpub/Command/Connect.php @@ -177,11 +177,13 @@ class Command_Connect protected function getBrowserAuthUrl($host, $user, $redirect_uri, $state, $scope) { + $sep = strpos($host->endpoints->authorization, '?') === false + ? '?' : '&'; return $host->endpoints->authorization - . '?me=' . urlencode($user) + . $sep . 'me=' . urlencode($user) . '&client_id=' . urlencode(static::$client_id) . '&redirect_uri=' . urlencode($redirect_uri) - . '&state=' . $state + . '&state=' . urlencode($state) . '&scope=' . urlencode($scope) . '&response_type=code'; } -- 2.30.2