Setting XCreds Preferences with Defaults

You are here:

Both the license file and preferences for XCreds are typically set with an MDM. However, these settings are just preferences provided in the System domain and can be set manually. Below is a script to show how to set basic settings and the license file using a script.



#Copy the text between <data> and </data> from the LicenseFile key and paste it between the quotes below


#check to make sure are running as root to put into system domain
if [ "$(id)" != 0 ]; then 
	echo "Please use sudo"

#convert license file to hex since default command doesn't understand base64
license_hex=$(echo "${license_base64}" |base64 -d|xxd -p|tr -d "\n")

#write out keys. Add keys as needed
defaults write "${app_id}" discoveryURL ""
defaults write "${app_id}" redirectURI ""
defaults write "${app_id}" scopes "profile openid email offline_access"
defaults write "${app_id}" clientID "5487c4cd-949a-402d-9eee-ae8fb696b415"

defaults write "${app_id}" "LicenseFile" -data "${license_hex}"