protected void parseAuthenticationWithExtensions(AuthenticationRequest authenticationRequest) {
        for (XMLObject xmlObject : authenticationRequest.getAuthnRequest().getExtensions().getUnknownXMLObjects(Attribute.DEFAULT_ELEMENT_NAME)) {
            Attribute attribute = (Attribute) xmlObject;
            switch (attribute.getName()) {
                case AttributeTypes.INTENDED_AUDIENCE -> {
                    authenticationRequest.setServiceEntityId(getStringValue(attribute.getAttributeValues().get(0)));
                    for (XMLObject entityId : attribute.getAttributeValues())
                        authenticationRequest.addIntendedAudience(getStringValue(entityId));
                }
                case AttributeTypes.SERVICE_UUID -> authenticationRequest.setServiceUuid(getStringValue(attribute.getAttributeValues().get(0)));
                case AttributeTypes.IDP_ASSERTION -> {
                    XSAny any = (XSAny) attribute.getAttributeValues().get(0);
                    Assertion assertion = (Assertion) any.getUnknownXMLObjects(Assertion.DEFAULT_ELEMENT_NAME).get(0);
                    authenticationRequest.setIdpAssertion(assertion);
                }
                default -> {}
            }
        }
    }
@Test //entrance
    protected void parseAuthenticationWithExtensionsTest() throws SamlSessionException, DienstencatalogusException, SharedServiceClientException, UnsupportedEncodingException, SamlParseException, ComponentInitializationException, SamlValidationException, MessageDecodingException {
        String samlRequest = readXMLFile(authnRequestEntranceExtensionsFile);
        String decodeSAMLRequest = encodeAuthnRequest(samlRequest);
        httpServletRequestMock.setParameter("SAMLRequest", decodeSAMLRequest);

        AuthenticationRequest result = authenticationService.startAuthenticationProcess(httpServletRequestMock);

        assertNotNull(result);
        assertEquals(frontChannel.concat(ENTRANCE_REQUEST_AUTHENTICATION_URL), result.getAuthnRequest().getDestination());
    }