SAML Authentication for Chrome in Mac OS

The SAML authentication for Chrome is not supported as well as running in Windows.

Here is what we need to do:

#!/bin/sh
loggedInUser=`python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");'`
echo $loggedInUser
sudo -u $loggedInUser defaults write com.google.Chrome AuthServerWhitelist "Your SAML URL"
sudo -u $loggedInUser defaults write com.google.Chrome AuthNegotiateDelegateWhitelist "Your SAML URL"
echo $(date)
exit 0

There you go, restart your Chrome, and enjoy. :)

Like what you read? Give River Yang a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.