Mount AFP share with ADSSO authentication using NetFSMountURLSync

Hello!

I am trying to use NetFSMountURLSync to mount an AFP network share on a macOS machine, using ADSSO to authenticate against the server.

When using the mount_afp binary to do the mounting, it is sufficient to specify the share URL as afp://;AUTH=Client%20Krb%20v2@<hostname>/<share>, as documented in man mount_afp. However, I cannot find documentation on how to achieve that with NetFSMountURLSync.

I prefer the NetFS-based method compared to mount_afp, because it does not require the mount point directory to exist before the mount.

I'm calling NetFSMountURLSync via Python's objc in a way inspired by this Gist. I tried specifying "Client Krb v2" as the username parameter of the NetFSMountURLSync call but nothing like that seems to work. Has anyone solved this before by any chance?
I use NetFSMountURLAsync quite a bit in code, but moved off AFP a while ago. Is there a particular reason you're not using SMB at this stage?
You might mention the error code returned, any options you're providing in the two arguments.
It's possible mount_afp processes the URL (ParseAFPURL and uamName) and sends the AUTH parameter as an option to mount(2). Technically such options should be supported by the keys in NetFS.h, but only the general ones are documented (and some like allow loopback are broken).
Mount AFP share with ADSSO authentication using NetFSMountURLSync
 
 
Q