Skip to main content

spent 2 hours to figured out how to enable Okta extension for Safari, post it here if someone need it.

 

 

#!/bin/zsh
# Safari Extensions File Path(my is macos 11.6):
# ~/Library/Containers/com.apple.Safari/Data/Library/Safari/WebExtensions/Extensions.plist
username=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`
cd /Users/$username/Library/Containers/com.apple.Safari/Data/Library/Safari/WebExtensions/
enabled=$(plutil -extract "okta\\.ExtensionLauncher\\.Extension\\.WebExtension (B7F62B65BN)".Enabled raw Extensions.plist)
if [ "$enabled" = "false" ]; then
plutil -replace "okta\\.ExtensionLauncher\\.Extension\\.WebExtension (B7F62B65BN)".Enabled -bool "Yes" Extensions.plist
jamf displayMessage -message "Okta Extension is enabled for Safari, please quit and reopen Safari."
else
echo "Okta Extension already enabled."
fi

 

 

 

Click Open Safari in the separate window. Enable the extension by navigating to Safari > Preferences > Extensions in your toolbar at the top left corner of your screen and checking the box for the Okta Extension App. Sign into the Okta End-User Dashboard to complete the setup.

 

alaskasworld


@Rowan45 you are right, we can manually enable it. but for hundreds of computers we need a better solution.


You sir, have done this world a great favor.


Does this still work on Monterey? When running as script from terminal it works, but after uploading to Jamf and executing a policy it returns an error: "CFURLCopyResourcePropertyForKey failed because it was passed a URL which has no scheme"


Does this still work on Monterey? When running as script from terminal it works, but after uploading to Jamf and executing a policy it returns an error: "CFURLCopyResourcePropertyForKey failed because it was passed a URL which has no scheme"


it should work, maybe you need full disk access to run the script from jamf policy, the Safari folder is protected by SIP.

https://lapcatsoftware.com/articles/containers.html


it should work, maybe you need full disk access to run the script from jamf policy, the Safari folder is protected by SIP.

https://lapcatsoftware.com/articles/containers.html


Worked like a charm, thanks Steven


Reply