Enable Okta Extension for Safari

Steven_Xu
Contributor

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

 

 

 

6 REPLIES 6

Rowan45
New Contributor

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

Steven_Xu
Contributor

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

eatkins
New Contributor II

You sir, have done this world a great favor.

iseeetray
New Contributor II

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

iseeetray
New Contributor II

Worked like a charm, thanks Steven