deploy
All checks were successful
Deploy / deploy-staging (push) Successful in 29s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-06-27 23:59:21 +02:00
parent dad3e0a629
commit 2d46b05b1e
7 changed files with 209 additions and 41 deletions

View File

@@ -62,7 +62,10 @@ final class KeycloakAuth
return $this->allowDesktopPreview() && isset($_GET[$previewKey]);
}
public function loginUrl(): ?string
/**
* @param array<string, string> $authorizeOverrides
*/
public function loginUrl(array $authorizeOverrides = []): ?string
{
if (!$this->isConfigured()) {
return null;
@@ -70,6 +73,7 @@ final class KeycloakAuth
$state = bin2hex(random_bytes(16));
$_SESSION['keycloak_oauth_state'] = $state;
$_SESSION['keycloak_oauth_mode'] = (string) ($authorizeOverrides['prompt'] ?? '') === 'none' ? 'silent' : 'interactive';
$params = array_merge(
[
@@ -83,6 +87,7 @@ final class KeycloakAuth
? $this->config['extra_authorize_params']
: []
);
$params = array_merge($params, $authorizeOverrides);
return rtrim($this->baseUrl(), '/')
. '/realms/' . rawurlencode($this->realm())