diff --git a/core/Controller/ClientFlowLoginController.php b/core/Controller/ClientFlowLoginController.php
index 2ba26deb0e7..d67a065a14e 100644
--- a/core/Controller/ClientFlowLoginController.php
+++ b/core/Controller/ClientFlowLoginController.php
@@ -162,12 +162,8 @@ class ClientFlowLoginController extends Controller {
* @PublicPage
* @NoCSRFRequired
* @UseSession
- *
- * @param string $clientIdentifier
- *
- * @return StandaloneTemplateResponse
*/
- public function showAuthPickerPage($clientIdentifier = '') {
+ public function showAuthPickerPage(string $clientIdentifier = '', int $direct = 0): StandaloneTemplateResponse {
$clientName = $this->getClientName();
$client = null;
if ($clientIdentifier !== '') {
@@ -218,6 +214,7 @@ class ClientFlowLoginController extends Controller {
'stateToken' => $stateToken,
'serverHost' => $this->getServerPath(),
'oauthState' => $this->session->get('oauth.state'),
+ 'direct' => $direct,
],
'guest'
);
@@ -231,13 +228,10 @@ class ClientFlowLoginController extends Controller {
* @NoCSRFRequired
* @NoSameSiteCookieRequired
* @UseSession
- *
- * @param string $stateToken
- * @param string $clientIdentifier
- * @return StandaloneTemplateResponse
*/
- public function grantPage($stateToken = '',
- $clientIdentifier = '') {
+ public function grantPage(string $stateToken = '',
+ string $clientIdentifier = '',
+ int $direct = 0): StandaloneTemplateResponse {
if (!$this->isValidToken($stateToken)) {
return $this->stateTokenForbiddenResponse();
}
@@ -267,6 +261,7 @@ class ClientFlowLoginController extends Controller {
'stateToken' => $stateToken,
'serverHost' => $this->getServerPath(),
'oauthState' => $this->session->get('oauth.state'),
+ 'direct' => $direct,
],
'guest'
);
diff --git a/core/templates/loginflow/authpicker.php b/core/templates/loginflow/authpicker.php
index 02b4b9cc003..4c4c8fd6d53 100644
--- a/core/templates/loginflow/authpicker.php
+++ b/core/templates/loginflow/authpicker.php
@@ -46,7 +46,7 @@ $urlGenerator = $_['urlGenerator'];
- +
@@ -62,6 +62,9 @@ $urlGenerator = $_['urlGenerator']; + + + diff --git a/core/templates/loginflow/grant.php b/core/templates/loginflow/grant.php index 0f1b9235a89..c537c47ea64 100644 --- a/core/templates/loginflow/grant.php +++ b/core/templates/loginflow/grant.php @@ -39,14 +39,17 @@ $urlGenerator = $_['urlGenerator'];-
diff --git a/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php b/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php index 3fdbe8de1e1..b98d4a99fb5 100644 --- a/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php +++ b/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php @@ -223,6 +223,9 @@ class SecurityMiddleware extends Middleware { if (isset($this->request->server['REQUEST_URI'])) { $params['redirect_url'] = $this->request->server['REQUEST_URI']; } + if ($this->request->getParam('direct')) { + $params['direct'] = 1; + } $url = $this->urlGenerator->linkToRoute('core.login.showLoginForm', $params); $response = new RedirectResponse($url); } else { diff --git a/tests/Core/Controller/ClientFlowLoginControllerTest.php b/tests/Core/Controller/ClientFlowLoginControllerTest.php index 51a17743c93..c60c89407bd 100644 --- a/tests/Core/Controller/ClientFlowLoginControllerTest.php +++ b/tests/Core/Controller/ClientFlowLoginControllerTest.php @@ -183,6 +183,7 @@ class ClientFlowLoginControllerTest extends TestCase { 'stateToken' => 'StateToken', 'serverHost' => 'https://example.com', 'oauthState' => 'OauthStateToken', + 'direct' => 0, ], 'guest' ); @@ -246,6 +247,7 @@ class ClientFlowLoginControllerTest extends TestCase { 'stateToken' => 'StateToken', 'serverHost' => 'https://example.com', 'oauthState' => 'OauthStateToken', + 'direct' => 0, ], 'guest' );