Search in sources :

Example 11 with ManageParticipantIdentifierServiceCaller

use of com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller in project peppol-commons by phax.

the class SMLFuncTest method testDnsCreation.

@Test
@Ignore("Requires a local SML for testing")
public void testDnsCreation() throws Exception {
    final ManageParticipantIdentifierServiceCaller aPIClient = new ManageParticipantIdentifierServiceCaller(SML_INFO);
    aPIClient.setSSLSocketFactory(createConfiguredSSLSocketFactory(SML_INFO, false));
    final IParticipantIdentifier aPI = PeppolIdentifierFactory.INSTANCE.createParticipantIdentifierWithDefaultScheme(TEST_BUSINESS_IDENTIFIER1);
    try {
        aPIClient.delete(SMP_ID, aPI);
    } catch (final com.helger.peppol.smlclient.participant.NotFoundFault e) {
    // Do nothing since we just want to make sure it doesn't exists.
    }
    final String sDNSString = "http://" + TEST_BUSINESS_IDENTIFIER1 + ".0010.ubis.sml.smloc.org/";
    InetAddress aAddress;
    try {
        aAddress = InetAddress.getByName(sDNSString);
        fail("The hostname shouldn't exist");
    } catch (final UnknownHostException e) {
    // This should happen!
    }
    aPIClient.create(m_aServiceMetadataPublisher.getServiceMetadataPublisherID(), aPI);
    aAddress = InetAddress.getByName(sDNSString);
    assertEquals(P_ENDPOINTADDRESS, aAddress.getHostAddress());
}
Also used : UnknownHostException(java.net.UnknownHostException) InetAddress(java.net.InetAddress) ManageParticipantIdentifierServiceCaller(com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller) IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 12 with ManageParticipantIdentifierServiceCaller

use of com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller in project phoss-smp by phax.

the class APIExecutorMigrationOutboundStartPut method invokeAPI.

public void invokeAPI(@Nonnull final IAPIDescriptor aAPIDescriptor, @Nonnull @Nonempty final String sPath, @Nonnull final Map<String, String> aPathVariables, @Nonnull final IRequestWebScopeWithoutResponse aRequestScope, @Nonnull final UnifiedResponse aUnifiedResponse) throws Exception {
    final String sServiceGroupID = aPathVariables.get(SMPRestFilter.PARAM_SERVICE_GROUP_ID);
    final ISMPServerAPIDataProvider aDataProvider = new SMPRestDataProvider(aRequestScope, sServiceGroupID);
    // Is the writable API disabled?
    if (SMPMetaManager.getSettings().isRESTWritableAPIDisabled()) {
        throw new SMPPreconditionFailedException("The writable REST API is disabled. migrationOutboundStart will not be executed", aDataProvider.getCurrentURI());
    }
    final String sLogPrefix = "[REST API Migration-Outbound-Start] ";
    LOGGER.info(sLogPrefix + "Starting outbound migration for Service Group ID '" + sServiceGroupID + "'");
    // Only authenticated user may do so
    final BasicAuthClientCredentials aBasicAuth = getMandatoryAuth(aRequestScope.headers());
    SMPUserManagerPhoton.validateUserCredentials(aBasicAuth);
    final ISMPSettings aSettings = SMPMetaManager.getSettings();
    final ISMLInfo aSMLInfo = aSettings.getSMLInfo();
    final IIdentifierFactory aIdentifierFactory = SMPMetaManager.getIdentifierFactory();
    final ISMPServiceGroupManager aServiceGroupMgr = SMPMetaManager.getServiceGroupMgr();
    final ISMPParticipantMigrationManager aParticipantMigrationMgr = SMPMetaManager.getParticipantMigrationMgr();
    if (aSMLInfo == null) {
        throw new SMPPreconditionFailedException("Currently no SML is available. Please select it in the UI at the 'SMP Settings' page", aDataProvider.getCurrentURI());
    }
    if (!aSettings.isSMLEnabled()) {
        throw new SMPPreconditionFailedException("SML Connection is not enabled hence no participant can be migrated", aDataProvider.getCurrentURI());
    }
    final IParticipantIdentifier aServiceGroupID = aIdentifierFactory.parseParticipantIdentifier(sServiceGroupID);
    if (aServiceGroupID == null) {
        // Invalid identifier
        throw SMPBadRequestException.failedToParseSG(sServiceGroupID, aDataProvider.getCurrentURI());
    }
    // Check that service group exists
    if (!aServiceGroupMgr.containsSMPServiceGroupWithID(aServiceGroupID)) {
        throw new SMPBadRequestException("The Service Group '" + sServiceGroupID + "' does not exist", aDataProvider.getCurrentURI());
    }
    // Ensure no existing migration is in process
    if (aParticipantMigrationMgr.containsOutboundMigrationInProgress(aServiceGroupID)) {
        throw new SMPBadRequestException("The outbound Participant Migration of the Service Group '" + sServiceGroupID + "' is already in progress", aDataProvider.getCurrentURI());
    }
    String sMigrationKey = null;
    try {
        final ManageParticipantIdentifierServiceCaller aCaller = new ManageParticipantIdentifierServiceCaller(aSMLInfo);
        aCaller.setSSLSocketFactory(SMPKeyManager.getInstance().createSSLContext().getSocketFactory());
        // Create a random migration key,
        // Than call SML
        sMigrationKey = aCaller.prepareToMigrate(aServiceGroupID, SMPServerConfiguration.getSMLSMPID());
        LOGGER.info(sLogPrefix + "Successfully called prepareToMigrate on SML. Created migration key is '" + sMigrationKey + "'");
    } catch (final BadRequestFault | InternalErrorFault | NotFoundFault | UnauthorizedFault | ClientTransportException ex) {
        throw new SMPSMLException("Failed to call prepareToMigrate on SML for Service Group '" + sServiceGroupID + "'", ex);
    }
    // Remember internally
    final ISMPParticipantMigration aMigration = aParticipantMigrationMgr.createOutboundParticipantMigration(aServiceGroupID, sMigrationKey);
    if (aMigration == null) {
        throw new SMPInternalErrorException("Failed to create outbound Participant Migration for '" + sServiceGroupID + "' internally");
    }
    LOGGER.info(sLogPrefix + "Successfully created outbound Participant Migration with ID '" + aMigration.getID() + "' internally.");
    // Build result
    final IMicroDocument aResponseDoc = new MicroDocument();
    final IMicroElement eRoot = aResponseDoc.appendElement("migrationOutboundResponse");
    eRoot.setAttribute("success", true);
    eRoot.appendElement(XML_ELEMENT_PARTICIPANT_ID).appendText(sServiceGroupID);
    eRoot.appendElement(XML_ELEMENT_MIGRATION_KEY).appendText(sMigrationKey);
    final XMLWriterSettings aXWS = new XMLWriterSettings().setIndent(EXMLSerializeIndent.INDENT_AND_ALIGN);
    aUnifiedResponse.setContentAndCharset(MicroWriter.getNodeAsString(aResponseDoc, aXWS), aXWS.getCharset()).setMimeType(new MimeType(CMimeType.APPLICATION_XML).addParameter(CMimeType.PARAMETER_NAME_CHARSET, aXWS.getCharset().name())).disableCaching();
}
Also used : ClientTransportException(com.sun.xml.ws.client.ClientTransportException) ISMPServiceGroupManager(com.helger.phoss.smp.domain.servicegroup.ISMPServiceGroupManager) BadRequestFault(com.helger.peppol.smlclient.participant.BadRequestFault) ISMLInfo(com.helger.peppol.sml.ISMLInfo) NotFoundFault(com.helger.peppol.smlclient.participant.NotFoundFault) SMPSMLException(com.helger.phoss.smp.exception.SMPSMLException) CMimeType(com.helger.commons.mime.CMimeType) MimeType(com.helger.commons.mime.MimeType) IMicroDocument(com.helger.xml.microdom.IMicroDocument) MicroDocument(com.helger.xml.microdom.MicroDocument) ISMPParticipantMigration(com.helger.phoss.smp.domain.pmigration.ISMPParticipantMigration) ISMPServerAPIDataProvider(com.helger.phoss.smp.restapi.ISMPServerAPIDataProvider) ISMPParticipantMigrationManager(com.helger.phoss.smp.domain.pmigration.ISMPParticipantMigrationManager) IIdentifierFactory(com.helger.peppolid.factory.IIdentifierFactory) SMPBadRequestException(com.helger.phoss.smp.exception.SMPBadRequestException) XMLWriterSettings(com.helger.xml.serialize.write.XMLWriterSettings) ManageParticipantIdentifierServiceCaller(com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller) UnauthorizedFault(com.helger.peppol.smlclient.participant.UnauthorizedFault) SMPPreconditionFailedException(com.helger.phoss.smp.exception.SMPPreconditionFailedException) BasicAuthClientCredentials(com.helger.http.basicauth.BasicAuthClientCredentials) ISMPSettings(com.helger.phoss.smp.settings.ISMPSettings) SMPInternalErrorException(com.helger.phoss.smp.exception.SMPInternalErrorException) IMicroElement(com.helger.xml.microdom.IMicroElement) IMicroDocument(com.helger.xml.microdom.IMicroDocument) InternalErrorFault(com.helger.peppol.smlclient.participant.InternalErrorFault) IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier)

Example 13 with ManageParticipantIdentifierServiceCaller

use of com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller in project phoss-smp by phax.

the class PageSecureServiceGroupMigrationInbound method validateAndSaveInputParameters.

@Override
protected void validateAndSaveInputParameters(@Nonnull final WebPageExecutionContext aWPEC, @Nullable final ISMPParticipantMigration aSelectedObject, @Nonnull final FormErrorList aFormErrors, @Nonnull final EWebPageFormAction eFormAction) {
    final ISMPServiceGroupManager aServiceGroupMgr = SMPMetaManager.getServiceGroupMgr();
    final IIdentifierFactory aIdentifierFactory = SMPMetaManager.getIdentifierFactory();
    final ISMPSettings aSettings = SMPMetaManager.getSettings();
    final ISMPParticipantMigrationManager aParticipantMigrationMgr = SMPMetaManager.getParticipantMigrationMgr();
    final String sMigrationKey = aWPEC.params().getAsStringTrimmed(FIELD_MIGRATION_KEY);
    final String sParticipantIDScheme = aWPEC.params().getAsStringTrimmed(FIELD_PARTICIPANT_ID_SCHEME);
    final String sParticipantIDValue = aWPEC.params().getAsStringTrimmed(FIELD_PARTICIPANT_ID_VALUE);
    IParticipantIdentifier aParticipantID = null;
    final String sOwningUserID = aWPEC.params().getAsStringTrimmed(FIELD_OWNING_USER_ID);
    final IUser aOwningUser = PhotonSecurityManager.getUserMgr().getUserOfID(sOwningUserID);
    final String sExtension = aWPEC.params().getAsStringTrimmed(FIELD_EXTENSION);
    // validations
    if (StringHelper.hasNoText(sMigrationKey))
        aFormErrors.addFieldError(FIELD_MIGRATION_KEY, "The migration key must not be empty!");
    else if (!SMPParticipantMigration.isValidMigrationKey(sMigrationKey))
        aFormErrors.addFieldError(FIELD_MIGRATION_KEY, "The migration key is not valid. Please verify the received code is correct.");
    if (aIdentifierFactory.isParticipantIdentifierSchemeMandatory() && StringHelper.hasNoText(sParticipantIDScheme))
        aFormErrors.addFieldError(FIELD_PARTICIPANT_ID_SCHEME, "Participant ID scheme must not be empty!");
    else if (StringHelper.hasNoText(sParticipantIDValue))
        aFormErrors.addFieldError(FIELD_PARTICIPANT_ID_VALUE, "Participant ID value must not be empty!");
    else {
        aParticipantID = aIdentifierFactory.createParticipantIdentifier(sParticipantIDScheme, sParticipantIDValue);
        if (aParticipantID == null)
            aFormErrors.addFieldError(FIELD_PARTICIPANT_ID_VALUE, "The provided participant ID has an invalid syntax!");
        else if (aServiceGroupMgr.getSMPServiceGroupOfID(aParticipantID) != null)
            aFormErrors.addFieldError(FIELD_PARTICIPANT_ID_VALUE, "Another service group for the same participant ID is already present (may be case insensitive)!");
    }
    if (StringHelper.hasNoText(sOwningUserID))
        aFormErrors.addFieldError(FIELD_OWNING_USER_ID, "Owning User must not be empty!");
    else if (aOwningUser == null)
        aFormErrors.addFieldError(FIELD_OWNING_USER_ID, "Provided owning user does not exist!");
    if (StringHelper.hasText(sExtension)) {
        final IMicroDocument aDoc = MicroReader.readMicroXML(sExtension);
        if (aDoc == null)
            aFormErrors.addFieldError(FIELD_EXTENSION, "The extension must be XML content.");
    }
    final HCNodeList aRedirectNotes = new HCNodeList();
    if (aFormErrors.isEmpty()) {
        // create the Service Group locally
        try {
            final ManageParticipantIdentifierServiceCaller aCaller = new ManageParticipantIdentifierServiceCaller(aSettings.getSMLInfo());
            aCaller.setSSLSocketFactory(SMPKeyManager.getInstance().createSSLContext().getSocketFactory());
            // SML call
            aCaller.migrate(aParticipantID, sMigrationKey, SMPServerConfiguration.getSMLSMPID());
            LOGGER.info("Successfully migrated '" + aParticipantID.getURIEncoded() + "' in the SML to this SMP using migration key '" + sMigrationKey + "'");
            aRedirectNotes.addChild(success("Successfully migrated '" + aParticipantID.getURIEncoded() + "' in SML to this SMP using migration key ").addChild(code(sMigrationKey)));
        } catch (final Exception ex) {
            LOGGER.error("Error invoking migrate on SML", ex);
            // Use a global field error here, to avoid that users must enter the
            // values over and over in case of error
            aFormErrors.add(SingleError.builderError().errorText("Failed to confirm the migration for participant '" + aParticipantID.getURIEncoded() + "' in SML, hence the migration failed." + " Please check the participant identifier and the migration key.\n" + BootstrapTechnicalUI.getTechnicalDetailsString(ex, CSMPServer.DEFAULT_LOCALE)).build());
            if (false)
                aWPEC.postRedirectGetInternal(error("Failed to confirm the migration for participant '" + aParticipantID.getURIEncoded() + "' in SML, hence the migration failed." + " Please check the participant identifier and the migration key.").addChild(SMPCommonUI.getTechnicalDetailsUI(ex)));
        }
    }
    if (aFormErrors.isEmpty()) {
        // Now create the service group locally (it was already checked that the
        // PID is available on this SMP)
        ISMPServiceGroup aSG = null;
        Exception aCaughtEx = null;
        try {
            // Do NOT create in SMK/SML
            aSG = aServiceGroupMgr.createSMPServiceGroup(aOwningUser.getID(), aParticipantID, sExtension, false);
        } catch (final Exception ex) {
            aCaughtEx = ex;
        }
        if (aSG != null) {
            aRedirectNotes.addChild(success("The new SMP Service Group for participant '" + aParticipantID.getURIEncoded() + "' was successfully created."));
        } else {
            aRedirectNotes.addChild(error("Error creating the new SMP Service Group for participant '" + aParticipantID.getURIEncoded() + "'.").addChild(SMPCommonUI.getTechnicalDetailsUI(aCaughtEx)));
        }
        // Remember internally
        if (aParticipantMigrationMgr.createInboundParticipantMigration(aParticipantID, sMigrationKey) != null) {
            aRedirectNotes.addChild(success().addChild(div("The participant migration for '" + aParticipantID.getURIEncoded() + "' with migration key ").addChild(code(sMigrationKey)).addChild(" was successfully performed.")).addChild(div("Please inform the source SMP that the migration was successful.")));
        } else {
            aRedirectNotes.addChild(error("Failed to store the participant migration for '" + aParticipantID.getURIEncoded() + "'."));
        }
        aWPEC.postRedirectGetInternal(aRedirectNotes);
    }
}
Also used : ISMPServiceGroupManager(com.helger.phoss.smp.domain.servicegroup.ISMPServiceGroupManager) HCNodeList(com.helger.html.hc.impl.HCNodeList) ISMPSettings(com.helger.phoss.smp.settings.ISMPSettings) ISMPServiceGroup(com.helger.phoss.smp.domain.servicegroup.ISMPServiceGroup) IUser(com.helger.photon.security.user.IUser) ISMPParticipantMigrationManager(com.helger.phoss.smp.domain.pmigration.ISMPParticipantMigrationManager) PDTToString(com.helger.commons.datetime.PDTToString) IMicroDocument(com.helger.xml.microdom.IMicroDocument) IIdentifierFactory(com.helger.peppolid.factory.IIdentifierFactory) ManageParticipantIdentifierServiceCaller(com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller) IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier)

Example 14 with ManageParticipantIdentifierServiceCaller

use of com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller in project phoss-smp by phax.

the class RegistrationHookWriteToSML method _createSMLCaller.

@Nonnull
private static ManageParticipantIdentifierServiceCaller _createSMLCaller() {
    // SML endpoint (incl. the service name)
    final ISMLInfo aSMLInfo = SMPMetaManager.getSettings().getSMLInfo();
    if (aSMLInfo == null)
        throw new IllegalStateException("Failed to get SML manage participant endpoint URL");
    final URL aSMLEndpointURL = aSMLInfo.getManageParticipantIdentifierEndpointAddress();
    final String sEndpointURL = aSMLEndpointURL.toExternalForm();
    final String sLowerURL = sEndpointURL.toLowerCase(Locale.US);
    if (LOGGER.isInfoEnabled())
        LOGGER.info("Performing SML query to '" + sEndpointURL + "'");
    // SSL socket factory
    final SSLSocketFactory aSocketFactory;
    if (sLowerURL.startsWith("https://")) {
        // https connection
        if (!SMPKeyManager.isKeyStoreValid())
            throw new InitializationException("Cannot init registration hook to SML, because private key/certificate setup has errors: " + SMPKeyManager.getInitializationError());
        try {
            aSocketFactory = SMPKeyManager.getInstance().createSSLContext().getSocketFactory();
        } catch (final Exception ex) {
            throw new IllegalStateException("Failed to init SSLContext for SML access", ex);
        }
    } else {
        // Local, http only access - no socket factory
        aSocketFactory = null;
    }
    // Hostname verifier
    final HostnameVerifier aHostnameVerifier;
    if (sLowerURL.contains("//localhost") || sLowerURL.contains("//127.0.0.1")) {
        // Accept all hostnames
        aHostnameVerifier = new HostnameVerifierVerifyAll(false);
    } else
        aHostnameVerifier = null;
    // Build WS client
    final ManageParticipantIdentifierServiceCaller ret = new ManageParticipantIdentifierServiceCaller(aSMLEndpointURL);
    ret.setSSLSocketFactory(aSocketFactory);
    ret.setHostnameVerifier(aHostnameVerifier);
    final Integer aConnectionTimeoutMS = SMPServerConfiguration.getSMLConnectionTimeoutMS();
    if (aConnectionTimeoutMS != null)
        ret.setConnectionTimeoutMS(aConnectionTimeoutMS.intValue());
    final int nRequestTimeoutMS = SMPServerConfiguration.getSMLRequestTimeoutMS();
    if (nRequestTimeoutMS >= 0)
        ret.setRequestTimeoutMS(nRequestTimeoutMS);
    return ret;
}
Also used : HostnameVerifierVerifyAll(com.helger.commons.ws.HostnameVerifierVerifyAll) ISMLInfo(com.helger.peppol.sml.ISMLInfo) SSLSocketFactory(javax.net.ssl.SSLSocketFactory) InitializationException(com.helger.commons.exception.InitializationException) URL(java.net.URL) InitializationException(com.helger.commons.exception.InitializationException) ManageParticipantIdentifierServiceCaller(com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller) HostnameVerifier(javax.net.ssl.HostnameVerifier) Nonnull(javax.annotation.Nonnull)

Example 15 with ManageParticipantIdentifierServiceCaller

use of com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller in project peppol-commons by phax.

the class SMLFuncTest method testMigrate.

@Test
public void testMigrate() throws Exception {
    final ManageParticipantIdentifierServiceCaller aPIClientOld = new ManageParticipantIdentifierServiceCaller(SML_INFO);
    aPIClientOld.setSSLSocketFactory(createConfiguredSSLSocketFactory(SML_INFO, false));
    final ManageServiceMetadataServiceCaller aClient2 = new ManageServiceMetadataServiceCaller(SML_INFO);
    aClient2.setSSLSocketFactory(createConfiguredSSLSocketFactory(SML_INFO, false));
    try {
        aClient2.delete(SMP_ID2);
    } catch (final NotFoundFault e) {
    // This is fine, since we are just cleaning
    }
    _createSMPData(aClient2, SMP_ID2);
    final ManageParticipantIdentifierServiceCaller aPIClientNew = new ManageParticipantIdentifierServiceCaller(SML_INFO);
    aPIClientNew.setSSLSocketFactory(createConfiguredSSLSocketFactory(SML_INFO, false));
    final IParticipantIdentifier aPI = PeppolIdentifierFactory.INSTANCE.createParticipantIdentifierWithDefaultScheme(TEST_BUSINESS_IDENTIFIER1);
    aPIClientOld.create(SMP_ID, aPI);
    final String sMigrationKey = aPIClientOld.prepareToMigrate(aPI, SMP_ID);
    assertNotNull(sMigrationKey);
    aPIClientNew.migrate(aPI, sMigrationKey, SMP_ID2);
    try {
        aPIClientOld.delete(SMP_ID, aPI);
        fail();
    } catch (final UnauthorizedFault e) {
    // This must happen.
    }
    // Should be able to delete, since New is now the owner
    aPIClientNew.delete(SMP_ID, aPI);
}
Also used : UnauthorizedFault(com.helger.peppol.smlclient.participant.UnauthorizedFault) ManageServiceMetadataServiceCaller(com.helger.peppol.smlclient.ManageServiceMetadataServiceCaller) NotFoundFault(com.helger.peppol.smlclient.smp.NotFoundFault) ManageParticipantIdentifierServiceCaller(com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller) IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier) Test(org.junit.Test)

Aggregations

ManageParticipantIdentifierServiceCaller (com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller)23 Test (org.junit.Test)16 IParticipantIdentifier (com.helger.peppolid.IParticipantIdentifier)13 UnauthorizedFault (com.helger.peppol.smlclient.participant.UnauthorizedFault)6 PeppolParticipantIdentifier (com.helger.peppolid.peppol.participant.PeppolParticipantIdentifier)6 ParticipantIdentifierPageType (com.helger.peppol.smlclient.participant.ParticipantIdentifierPageType)5 ParticipantIdentifierType (com.helger.xsds.peppol.id1.ParticipantIdentifierType)5 ISMLInfo (com.helger.peppol.sml.ISMLInfo)4 ManageServiceMetadataServiceCaller (com.helger.peppol.smlclient.ManageServiceMetadataServiceCaller)4 IIdentifierFactory (com.helger.peppolid.factory.IIdentifierFactory)4 ISMPParticipantMigrationManager (com.helger.phoss.smp.domain.pmigration.ISMPParticipantMigrationManager)4 ISMPSettings (com.helger.phoss.smp.settings.ISMPSettings)4 BadRequestFault (com.helger.peppol.smlclient.participant.BadRequestFault)3 ISMPServiceGroupManager (com.helger.phoss.smp.domain.servicegroup.ISMPServiceGroupManager)3 IMicroDocument (com.helger.xml.microdom.IMicroDocument)3 CommonsArrayList (com.helger.commons.collection.impl.CommonsArrayList)2 PDTToString (com.helger.commons.datetime.PDTToString)2 CMimeType (com.helger.commons.mime.CMimeType)2 MimeType (com.helger.commons.mime.MimeType)2 BasicAuthClientCredentials (com.helger.http.basicauth.BasicAuthClientCredentials)2