[quote='827788022, DTS Engineer, /thread/775664?answerId=827788022#827788022']
specialist
[/quote]
Sorry for my grammar makes you fell confused.
Well, I'm just seeking someone know more about CoreWLAN interface and hope he could teach us a precious lesson. It's pretty easy to accomplish that on Windows or Ubuntu, I mean, just by some commands or asking AI assistant. But I haven't find a usable command or an interface on that, so it's your show time.
I have told our guys to do something about MDM...But MDM system will deal with the profile pushing and installing procedure for sure. Will that solve the problem that users must click "CONNECT" when first connect to the SSID or plugin the cable?
Post
Replies
Boosts
Views
Activity
[quote='827647022, DTS Engineer, /thread/775664?answerId=827647022#827647022']
I don’t have enough experience with Core WLAN in enterprise setups to know whether this will work or not.
[/quote]
And if possible, would you like to help me contact a specialist to work out a solution? I believe an interface could be a common need since it could be a simple method to access enterprise network.
I saw some content about CWConfiguration in the CoreWLAN Guidance but not sure if it is related to the profiles command in macOS.
I agree with you(MDM will be a better bet), but we had a tight budget, or just not see it a choice in short time. Besides, some employees prefer to use their own computer to complete their work, which is not suitable for using MDM.
Anyway, thank you a lot and there are still two issues.
I considered to use CoreWLAN associateToNetwork:password:error:. However, it still took about 30 seconds to connect SSID. Since there is nothing like PROFILE in input params, so I see it has no difference with running command networksetup -setairportnetwork en1 myssid. Do you have any idea or tell me to use the correct function?
At least there is a CoreWLAN class. How to deal with the ethernet connection problem? Now it stucks at the step that must choose profile and click connect.
THANKS. Unfortunately we do't have an MDM, and our steps is
Develop an APP for users.
Users log into the APP and download their profile for 802.1X auth.
Install the profile manually(double click to install)
connect to the cable or the specific SSID
start auto-authentication.
The problem is users have to select the profile and click CONNECT or something to auth at the first time. That's why I said MANUALLY.
That could be a confusing operation. Writing a guidance is still hard to understand for some users. So I'm searching a way to help them bypass CLICKING the CONNECT BUTTON by command or coding.
I wrote a script and everything worked will when run by python.
import objc
from CoreLocation import CLLocationManager
import logging
location_manager = CLLocationManager.alloc().init()
location_manager.requestWhenInUseAuthorization()
logger = logging.getLogger()
logger.setLevel(logging.INFO)
fh = logging.FileHandler('/Users/xpeng/Downloads/logging.log')
fh.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
fh.setFormatter(formatter)
ch.setFormatter(formatter)
logger.addHandler(fh)
logger.addHandler(ch)
if __name__ == '__main__':
bundle_path = '/System/Library/Frameworks/CoreWLAN.framework'
objc.loadBundle('CoreWLAN',
bundle_path=bundle_path,
module_globals=globals())
iface = CWInterface.interface()
logger.info(str(iface.interfaceName()))
logger.info(iface.ssid())
networks, error = iface.scanForNetworksWithSSID_error_(None, None)
for network in networks:
logger.info(network.ssid())
But after I pyinstaller -w -F test.py and excute sudo open path_to_app, the log was like
2024-03-13 18:10:51,931 - root - INFO - en1
2024-03-13 18:10:51,935 - root - INFO - None
2024-03-13 18:10:53,546 - root - INFO - None
2024-03-13 18:10:53,547 - root - INFO - None
2024-03-13 18:10:53,547 - root - INFO - None
2024-03-13 18:10:53,547 - root - INFO - None
2024-03-13 18:10:53,547 - root - INFO - None
2024-03-13 18:10:53,547 - root - INFO - None
2024-03-13 18:10:53,547 - root - INFO - None
2024-03-13 18:10:53,548 - root - INFO - None
2024-03-13 18:10:53,548 - root - INFO - None
2024-03-13 18:10:53,548 - root - INFO - None
2024-03-13 18:10:53,548 - root - INFO - None
2024-03-13 18:10:53,548 - root - INFO - None
2024-03-13 18:10:53,548 - root - INFO - None
2024-03-13 18:10:53,548 - root - INFO - None
2024-03-13 18:10:53,548 - root - INFO - None
2024-03-13 18:10:53,548 - root - INFO - None
2024-03-13 18:10:53,549 - root - INFO - None
2024-03-13 18:10:53,549 - root - INFO - None
2024-03-13 18:10:53,549 - root - INFO - None
2024-03-13 18:10:53,549 - root - INFO - None
I did grant test location permission in system preferences.
Is there any other thing must do before I pack?