简体   繁体   English

Mulesoft使用基本身份验证连接到API,但没有密码

[英]Mulesoft connecting to API with Basic Authentication but no password

I am attempting to connect to the Insightly API through my mule esb project. 我正在尝试通过我的mule esb项目连接到Insightly API。 Insightly requires that you use Basic Authentication to connect to there API and they provide you with an API key to use as your username for authentication but they tell you to leave the password blank. Insightly要求您使用基本身份验证连接到那里的API,并且它们为您提供了一个API密钥用作您的身份验证用户名,但是它们告诉您将密码留空。

When using the HTTPS Request endpoint a password is required in Basic Authentication, so this is an issue for me. 使用HTTPS请求端点时,基本身份验证需要密码,因此这对我来说是个问题。 I have tried using a property placeholder as the password and then leaving the placeholder value as blank, and this allows me to run the flow, but errors out upon deployment. 我尝试使用属性占位符作为密码,然后将占位符值保留为空白,这使我可以运行流,但是在部署时会出错。

Does anyone have any idea how I can make this work, currently I have been using the deprecated http:outbound and inbound endpoints to make this work, but this is not a permanent solution, and I would like to get all of those deprecated endpoints over to the new HTTP Request connector. 有谁知道我如何进行这项工作,目前我一直在使用已弃用的http:outbound和inbound端点来完成这项工作,但这不是永久性的解决方案,我希望将所有那些已弃用的终结点到新的HTTP请求连接器。

Any and all help will be greatly appreciated! 任何和所有帮助将不胜感激!

Have you tried using MEL with an empty string: 您是否尝试过将MEL与空字符串一起使用:

<http:request path="/something" method="POST" config-ref="http">
    <http:basic-authentication username="USER" password="#['']" />
</http:request-config>

Or alternatively base64 the user and blank password and add the Authorization header yourself: 或者使用base64用户和空白密码,然后自己添加Authorization标头:

<http:request config-ref="http" path="/something" method="POST" doc:name="Request to BPM">
    <http:request-builder>
        <http:header headerName="Authorization" value="Basic a2VybWl0OnBhc3N3b3JkMQ=="/>
    </http:request-builder>
</http:request>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM