cmmoutes13
cmmoutes13

Reputation: 131

Mulesoft connecting to API with Basic Authentication but no password

I am attempting to connect to the Insightly API through my mule esb project. 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.

When using the HTTPS Request endpoint a password is required in Basic Authentication, so this is an issue for me. 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.

Any and all help will be greatly appreciated!

Upvotes: 1

Views: 2010

Answers (1)

Ryan Carter
Ryan Carter

Reputation: 11606

Have you tried using MEL with an empty string:

<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:

<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>

Upvotes: 0

Related Questions