All Apps and Add-ons

Splunk Add-On Builder: When base64 encodes the credentials, why does the REST API input insert a newline character in Basic Auth header?

sjodle
Path Finder

I'm building a REST API input using the Splunk Add-On Builder. I'm trying to set up basic authentication for the REST call. However, when base64 encoding the credentials, the input inserts a newline character ("\n") in the middle of the base64 string. This causes an "invalid header value" HTTPError in the script output.

Other than the newline character, the auth string generated matches the working one generated by Postman.

This may have to do with the relatively long username and password used (Account Sid and Access Token for the Twilio REST API), as quick tests with a short username and password on other APIs do not demonstrate the issue.

0 Karma

gwang_splunk
Splunk Employee
Splunk Employee

Are you using the simple REST based data input?
If yes, sounds like a bug.

0 Karma

sjodle
Path Finder

Yep. We've reported it as such (see ehaddad's answer below)

0 Karma

ehaddad_splunk
Splunk Employee
Splunk Employee

If you are using REST input (not advanced mode) - all you need to do is
1- drag"Global Account" under mod input params
2- check "basic authentication" under the testing step
3- Make sure you input the username/passwrod values under the add-on setup parameters.

Is that what you are doing?

0 Karma

sjodle
Path Finder

Yes. And that works, except that it inserts the extra \n into my authentication header.

0 Karma

ehaddad_splunk
Splunk Employee
Splunk Employee

Looks like a bug to me. can you please create a support case for us to track? I already used 2.1.0 against many basic auth REST API. I did not get a problem but could be that your API is more restrictive about the \n
We will try to reproduce at our our end.

0 Karma

sjodle
Path Finder

Thanks. We are in the process of creating the ticket.

0 Karma

sjodle
Path Finder

Ticket number 455389 submitted.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...