Authentication via iOS Device

Hello there, I've been looking into figuring out how to log in to a service without having to ask for an email/password combo. Given that there's no WebViews at the moment logging in via Twitter/FB does not seem to be an option for our application. Thus I would like to ask for people to use their login credentials via the iOS app. It feels like a lot of the advice on app groups is around sharing data, quite resonably, expects you to have the apps same device.


Is the recommended route to share authentication via app groups + nsuserdefaults/shared keychain? Or to try build your own over CoreBluetooth?

Internal discussion has lead to an eventual outcome like this:


1. You create a native auth view that offers the user 2 choices, either enter credentials (other view controller) or visit 'example.com/appletv' (on a device)
2. You register the ATV with the backend server, which stores the IP of the ATV (which presumably is the public WAN IP) and start polling the backend (x sec) for if the ATV is associated to a user
3. The user visits 'example.com/appletv' and signs-in (or is signed-in), the backend then associates the ATV that previously visited the backend from the same WAN IP with that user
4. The polling view sees that the ATV is now associated with that user and has access, and can store an auth token.


This is alright, but ideally there would be a way to use associated app-groups to be able to share auth. Definitely open to other ideas.

I'm toying with two differeng approaches to this.


1) CloudKit. Have a user login with their Apple ID on a web site or another app and with that shared container the Apple TV application will have access to the data. But CloudKit doesn't seem to be supported in the Apple TV Simulator. It crashes saying the entitlements aren't set up.


2) Running a web server within my Apple TV application, so via Bonjour in theory another app or browser running on the same network should be able to find that, and use HTTP as a communication method.


I'd love to hear what other people are doing for this.

This will be interesting for people wanting to share auth: https://medium.com/@bdotdub/signing-into-apps-on-apple-tv-*****-d36fd00e6712

Authentication via iOS Device
 
 
Q