class RpAuthnRequestTranslatorService {

    public TranslatedAuthnRequestDto translate(SamlRequestWithAuthnRequestInformationDto samlRequestWithAuthnRequestInformationDto) {
        AuthnRequest authnRequest = stringToAuthnRequestTransformer.apply(samlRequestWithAuthnRequestInformationDto.getSamlMessage());

        MdcHelper.addContextToMdc(authnRequest.getID(), authnRequest.getIssuer().getValue());

        AuthnRequestFromRelyingParty authnRequestFromRelyingParty = authnRequestToIdaRequestFromRelyingPartyTransformer.apply(authnRequest);

        if (authnRequestFromRelyingParty.getVerifyServiceProviderVersion().isPresent()) {
            LOG.info(String.format(
                "Issuer %s uses VSP version %s",
                authnRequestFromRelyingParty.getIssuer(),
                authnRequestFromRelyingParty.getVerifyServiceProviderVersion().get()
            ));
        }

        UnknownMethodAlgorithmLogger.probeAuthnRequestForMethodAlgorithm(authnRequestFromRelyingParty);

        return new TranslatedAuthnRequestDto(
            authnRequestFromRelyingParty.getId(),
            authnRequestFromRelyingParty.getIssuer(),
            authnRequestFromRelyingParty.getForceAuthentication(),
            authnRequestFromRelyingParty.getAssertionConsumerServiceUrl(),
            authnRequestFromRelyingParty.getAssertionConsumerServiceIndex());
    }

    @Inject public  RpAuthnRequestTranslatorService(
        StringToOpenSamlObjectTransformer<AuthnRequest> stringToAuthnRequestTransformer,
        AuthnRequestToIdaRequestFromRelyingPartyTransformer authnRequestToIdaRequestFromRelyingPartyTransformer
    );

}