1

This is one of the weirdest things...

I script adding passwords to Keychain Access when I log in to provide a "SSO" like experience. I use AppleScript to run some terminal commands that look like this†:

security add-internet-password -a $LOGNAME -j 'default' -s '$SHAREPOINT' -r htps -P 443 \
-T /Applications/Safari.app/Contents/MacOS/Safari \
-T /Applications/Microsoft\ Office\ 2011/Microsoft\ Document\ Connection.app/Contents/MacOS/Microsoft\ Document\ Connection \
-d '$SHAREPOINT' -w $PASSWORD -t 'ntlm'

Note that I have to use NTLM authentication for it to work right with MS Office apps.

However, when I do this, I get a keychain that looks like this (irrelevant lines trimmed)

keychain: "/Users/.../Library/Keychains/login.keychain"
class: "inet"
attributes:
    "ptcl"<uint32>="http"
    "sdmn"<blob>="sharepoint site"
    "srvr"<blob>="sharepoint site"
    "atyp"<blob>="mltn"

Note that the value for atyp "ntlm" was reversed to mltn. When I try and connect to Sharepoint it doesn't work. However, if I use the same command but change the last part to -t 'mltn' then it works!

keychain: "/Users/.../Library/Keychains/login.keychain"
class: "inet"
attributes:
    "ptcl"<uint32>="http"
    "sdmn"<blob>="sharepoint site"
    "srvr"<blob>="sharepoint site"
    "atyp"<blob>="ntlm"

See here that atyp has been reversed to 'ntlm' which allows MS Office apps to log in!

So I have a workaround, but I certainly feel yucky using it. Is there something I'm doing wrong here?

†The $PASSWORD variable is actually retrieved by prompting the user with a dialog so that they can type it once and pre-authenticate to several important websites in a single shot.

  • I've confirmed this happens on both Mountain Lion and Mavericks. – newz2000 Jun 7 '14 at 3:41
  • I've filed a bug with Apple, it is ID 17211381 and I will update this if I get a response. – newz2000 Jun 8 '14 at 2:34

You must log in to answer this question.

Browse other questions tagged .