Skip to main content
Question

issue with xpath -e and extension attributes

  • October 14, 2024
  • 3 replies
  • 26 views

Forum|alt.badge.img+1

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

AJPinto
Forum|alt.badge.img+26
  • Legendary Contributor
  • October 14, 2024

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
Forum|alt.badge.img+13
  • Jamf Heroes
  • October 14, 2024

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


Tangentism
Forum|alt.badge.img+10
  • Honored Contributor
  • October 15, 2024

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