issue with xpath -e and extension attributes

mathew_hall_wes
New Contributor

Hi We've noticed recently that a reliable script to return jamf ext attributes has stopped working in ventura, somona and sequia.

oldPass=$(curl -s -f -u $apiUser:$apiPass -H "Accept: application/xml" $apiURL/JSSResource/computers/udid/$udid/subset/extension_attributes | xpath -e "//extension_attribute[name=$extAttName]" 2>&1 | awk -F'<value>|</value>' '{print $2}' | tail -n +1 )

 

We used to be able to retrieve the value of an ext attribute with the above but it seems to have broken. i see lots online refering to "xmllint xpath" as a fix but doesn't work in our case, just returns an empty value.

3 REPLIES 3

AJPinto
Honored Contributor III

Jamf made pretty significant updates to their API about 6 months ago, make sure the command string uses current endpoints and still works with the disablement of basic authentication. As far as I am aware, an API script like that should not care what OS the host device is running.

Shyamsundar
New Contributor II

Enable the basic authentication , from settings - user account-password policy enable allow basic authentication in addition to bearer token 

Not a best practice as everyone should move to token authentication but seems to be conflicting information about it as its still available in 11.9!


Basic authentication in the Classic API is no longer supported and will be turned off for all 11.5.0 instances to provide enhanced security.


https://developer.jamf.com/jamf-pro/docs/classic-api-authentication-changes