SSO: Allow default authentication params for all URLs - refs BT#21881

pull/5753/head
Angel Fernando Quiroz Campos 1 year ago
parent 4c930fe811
commit 789a347d5a
No known key found for this signature in database
GPG Key ID: B284841AE3E562CD
  1. 2
      config/authentication.yaml
  2. 14
      src/CoreBundle/ServiceHelper/AuthenticationConfigHelper.php

@ -2,7 +2,7 @@
# Access URL Id / authentication method / params
parameters:
authentication:
1:
default:
generic:
enabled: false
client_id: ''

@ -23,15 +23,19 @@ readonly class AuthenticationConfigHelper
$authentication = $this->parameterBag->get('authentication');
if (!isset($authentication[$urlId])) {
throw new InvalidArgumentException('Invalid access URL Id');
if (isset($authentication[$urlId])) {
$urlParams = $authentication[$urlId];
} elseif (isset($authentication['default'])) {
$urlParams = $authentication['default'];
} else {
throw new InvalidArgumentException('Invalid access URL configuration');
}
if (!isset($authentication[$urlId][$providerName])) {
throw new InvalidArgumentException('Invalid authentication source');
if (!isset($urlParams[$providerName])) {
throw new InvalidArgumentException('Invalid authentication provider for access URL');
}
return $authentication[$urlId][$providerName];
return $urlParams[$providerName];
}
public function isEnabled(string $methodName, ?AccessUrl $url = null): bool

Loading…
Cancel
Save