A little http basic auth help needed

14 views
Skip to first unread message

John Lockwood

unread,
Mar 21, 2023, 6:40:24 AM3/21/23
to munki-discuss
I am building a new Apache2 server to host Munki and I have so far got a basic http virtual site redirecting to the https virtual site, I have the SSL server certs working and I have content being served.

I am now adding http basic auth to the setup and this is also working for when I manually go to the site and manually enter the credentials.

I have encoded the username:userpassword as base64 and added this to a mobile config and this is successfully being pushed out.

This is something I have done before but this time it is not working.

If in a script I read the plist entry and decode it from base64 and then send the decoded value as a curl parameter it works e.g.

(abbreviated command)
/usr/bin/curl --get -u "$Decoded_Auth"

if I do it with the base64 encoded value as a header like...

(also abbreviated)
/usr/bin/curl -X POST --header "Authorization: Basic ${Basic_Auth}"

It fails.

Whilst at this stage this is for a Munki 'enrolment' script I am concerned that the Munki client i.e. Managed Software Centre will also have the same issue.
Reply all
Reply to author
Forward
0 new messages