Hello. I'm developing on a cross-platform app to help user connect enterprise network and found it difficult in macOS.
The issue is, I guided user to install profile, but the authentication won't start immediately even the cable is plugged in or the WLAN is connected. There is still some manual operation to be done:
- Ethernet: Select the correct profile, and click the Connect button.
- Wlan: Click the Connect button. (The profile contains SSID so need't select the correct profile)
Obviously, the operation is still not easy for users to understand and follow. So, is there any method to auto connect 802.1x network using the selected profile in terminal or by code? I mean, the manual operation is not necessary, maybe you can tell me a better solution.
BTW, I found it possible to connect WLAN and auto select the correct profile by using this command
networksetup -setairportnetwork en1 MY_SSID
, but it could be very slow since the authentication seemed start 30 sec after connecting the SSID. So I believe it not the best solution.
Honestly, I think that’s the easiest path to a solution here. You can write code to do this, but it’s likely that you will run into roadblocks. You have to consider whether it’s better to spend your time getting around those roadblocks or spend your time rolling out an MDM system. My guess is that, in long term, MDM will be a better bet.
Anyway, it might be possible to get things working using the Core WLAN framework. It has APIs to create configurations from scratch and also to trigger an association. There are two approaches you could try out:
-
Continue installing a profile as you’re currently doing, and then forcing the association using Core WLAN.
-
Using Core WLAN to both create the profile and force the association.
I don’t have enough experience with Core WLAN in enterprise setups to know whether this will work or not. But if you’re committed to not using MDM, that’s the second best path forward.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"