getAssertionConsumerService() private static méthode

Find SP AssertionConsumerService based on parameter in AuthnRequest.
private static getAssertionConsumerService ( array $supportedBindings, SimpleSAML_Configuration $spMetadata, string | null $AssertionConsumerServiceURL, string | null $ProtocolBinding, integer | null $AssertionConsumerServiceIndex ) : array
$supportedBindings array The bindings we allow for the response.
$spMetadata SimpleSAML_Configuration The metadata for the SP.
$AssertionConsumerServiceURL string | null AssertionConsumerServiceURL from request.
$ProtocolBinding string | null ProtocolBinding from request.
$AssertionConsumerServiceIndex integer | null AssertionConsumerServiceIndex from request.
Résultat array Array with the Location and Binding we should use for the response.
    $binding = SAML2_Binding::getCurrentBinding();
    $request = $binding->receive();
    if (!$request instanceof SAML2_AuthnRequest) {
        throw new SimpleSAML_Error_BadRequest('Message received on authentication request endpoint wasn\'t an authentication request.');
    }
    $spEntityId = $request->getIssuer();
    if ($spEntityId === NULL) {
        throw new SimpleSAML_Error_BadRequest('Received message on authentication request endpoint without issuer.');
    }
    $spMetadata = $metadata->getMetaDataConfig($spEntityId, 'saml20-sp-remote');
    sspmod_saml_Message::validateMessage($spMetadata, $idpMetadata, $request);
    $supportedBindings = array(SAML2_Const::BINDING_PAOS);
    $consumerURL = $request->getAssertionConsumerServiceURL();
    $protocolBinding = $request->getProtocolBinding();
    $consumerIndex = $request->getAssertionConsumerServiceIndex();
    $acsEndpoint = sspmod_saml_IdP_SAML2::getAssertionConsumerService($supportedBindings, $spMetadata, $consumerURL, $protocolBinding, $consumerIndex);
    $relayState = $request->getRelayState();
    $requestId = $request->getId();
    $state = array();
    $state[sspmod_core_Auth_UserPassBase::AUTHID] = $auth;
    $state['LoginCompletedHandler'] = "ecp_finish_auth";
    $state['SPMetadata'] = $spMetadata->toArray();
    $state['saml:RequestId'] = $requestId;
    $state['saml:RelayState'] = $relayState;
    $state['saml:ConsumerURL'] = $acsEndpoint['Location'];
    $state['saml:Binding'] = $acsEndpoint['Binding'];
    $state['core:IdP'] = $idp->getId();
    /* Save the $state-array, so that we can restore it after a redirect. */
    $authStateId = SimpleSAML_Auth_State::saveState($state, sspmod_core_Auth_UserPassBase::STAGEID);
    sspmod_core_Auth_UserPassBase::handleLogin($authStateId, $username, $password);
} catch (SimpleSAML_Error_Error $e) {