Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.12.3 available

The official documentation can be found on https://wiki.ocsinventory-ng.org. Read it before asking your question.

MAC Client Basic Authentication + error 401

Hi together,

we have an ocs inventory server running on debian in version 2.6. Configured with https and basic authentification.

Everything is working fine with Windows Agents but I have troubles to get the MAC OS X clients to work. On client side, i get:

Cannot establish communication : 401 Unauthorized

So on sever side i seen that the client reach the right /ocsinventory path but with a total strange user:

 IPADDRESS- - [07/May/2020:13:50:34 +0200] "POST /ocsinventory HTTP/1.1" 401 5184 "-" "OCS-NG_unified_unix_agent_v2.6.1"
IPADDRESS- \xb2\xd6\xab}\xa7\x1e [07/May/2020:13:50:34 +0200] "POST /ocsinventory HTTP/1.1" 401 714 "-" "OCS-NG_unified_unix_agent_v2.6.1"

I have specified the realm, user and the password in the ocsinventory-agent.cfg in mac os with the following syntax:

server=https://FQDN:443/ocsinventory

realm="OCS Inventory agent area" (like in the server config file on ocs server)

user=USERNAME (plain text)

password=PASSWORD (plain text)

ssl=1

According to the access.log above the user name in plain text isn't recognize wright from an interpreter. Or do need to put it in a special format.

Thx,

Robbat

in OCS Inventory NG agent for MacOS X by (180 points)

3 Answers

0 votes
Hi,

try adding username and password to the https string of server line.

eg. server=https://username:password@FQDN:443/ocsinventory

Please keep in mind, that username and password will also be stored in the lib/ocsinventory-agent directory.

Best

Frank
by (180 points)
0 votes
Hi Frank,

thanks for help. Works like a charm!

GreeTz

Robbat
by (180 points)
0 votes

Hello Robbat, this is a laaaaaaaate answer but commit in v2.6.1 changed the way username and password works : they need to be filled with the base64 encoded data (echo -n "user" | base64 and echo -n "password" | base64)

cf https://github.com/OCSInventory-NG/UnixAgent/commit/2ee973db450d9b81f9c0fda519ba896487cb174e

This is not documented (yet?), we can only find an unexplicit mention in https://wiki.ocsinventory-ng.org/07.OCS-Tools/OCS-MacOSX-Packager/ and https://wiki.ocsinventory-ng.org/03.Basic-documentation/Setting-up-the-MacOSX-agent-on-client-computers/#installing-ocs-macosx-agent-2x.

 

by (150 points)
 
Powered by Question2Answer
...