开发者

how to check the user id of the user logged into the network using ipad app?

开发者 https://www.devze.com 2023-03-15 16:28 出处:网络
i have a wifi network that is authenticated. when the ipad is connected in that network i want my ipad app to bypa开发者_JAVA技巧ss the login and use those credentials to login to my app. is that poss

i have a wifi network that is authenticated. when the ipad is connected in that network i want my ipad app to bypa开发者_JAVA技巧ss the login and use those credentials to login to my app. is that possible?


It's not possible to find the particular user that was used to connect to the wifi through iOS. You might be able to do this if you have a server on your local network that is responsible for authenticating the username/password given to connect to the local wifi netowrk and then associate that with the address of the device. Then you could have a service that the iOS device could query and get the username from it.

So, you'd have

  1. iOS device connects to network with username/password
  2. wifi router authenticates user and logs username + MAC address
  3. you app sends request to server on network with the iOS device's mac address
  4. server looks up mac address and finds the username associated with it (from the second step)
  5. server returns username to iOS device app and you continue your app with that user


You could store the user's credentials in your app using NSUserDefaults after a first successful login.

But .. There is no API in iOS that will allow you to connect to a particular WiFi network, that is under your user's control.

0

精彩评论

暂无评论...
验证码 换一张
取 消