I’ve no idea why you’re getting this but it’s not a huge surprise: Authorisation plug-ins run in a very weird context.
It doesn't work even from the application context.
I ran 9 times a simple test containing only the following two line (I used PEAP as a authentication method):
[interface disassociate]; BOOL res = [interface associateToEnterpriseNetwork:network identity:nil username:myUsername password:myPassword error:&error];
2 times out of 9 I managed to connect to Wi-FI enterprise network without any prompts.
1 time out of 9 the method showed success, but I wasn't connected to Wi-Fi Enterprise network (It's strange, because in RADIUS server logs I see that "full access was granted")
6 times out of 9 the system kept asking for Wi-Fi credentials, which is weird because the correct credentials were specified as the parameters. Moreover, the associateToEnterpriseNetwork call was not blocking and terminated in a couple of seconds with the error code 1. But the credential prompt kept hanging, so I could enter the credentials and get connected to my enterprise network.
This behaviour looks unpredictable, it's quite glitchy .
As for the login window context, I tried to wrap the associateToEnterpriseNetwork method into a launched daemon and pull it from my authorisation plug-in. While I'm pulling the daemon being on the login window screen, I get the error -3903, the one i mentioned before. As soon as I leave the login window, my daemon stops showing the error -3903 and either works as expected or shows the error 1.
It looks like it's a bug.
Topic:
App & System Services
SubTopic:
Core OS
Tags: