-
Notifications
You must be signed in to change notification settings - Fork 777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tvOS support #111
Comments
If you are just signing in to your own OpenID service, you could build a native login flow for that and don't really need AppAuth. However, if you are instead asking how others could integrate with your service as a relying party, it's not really possible on tvOS - without a system browser, you would have to trust these relying parties to directly handle your user's credentials. The safer solution would probably be some "second screen" flow, where you have the user authorize the tvOS app using another device (like their iPhone / iPad). This is of course outside the scope of what OpenID Connect defines. |
@DarkDust this might be useful to you - https://tools.ietf.org/html/draft-ietf-oauth-device-flow |
Alright, thank you for clarifying this. We already suspected that we cannot solve this with AppAuth due to the design goals of AppAuth. The "second screen" flow as specified in the draft is what we already had in mind and is our long-term goal: nobody wants to enter long complicated user names and passwords on tvOS anyways ;-). Since we control both app and authentication service we went with a password flow for now. |
The Google extension to AppAuth includes tvOS support. However, it is hard-coded to Google, and the protocol is an out-of-date draft version of the OAuth Device Flow specification. I have a fork here: https://github.com/WilliamDenniss/GTMAppAuth/tree/interop to prove interoperability with the latest draft specification (the differences are fairly minor). My plan is to move this feature into AppAuth proper once the draft is submitted for publication. Until then, I would recommend starting with my Incidentally, this is the same auth protocol YouTube TV uses for Sign-in across all surface areas. |
Status of tvOS code in GTMAppAuthAn update on the status of the tvOS support in GTMAppAuth (Google's open source AppAuth extension): The tvOS code was removed from the GTMAppAuth releases. The branch tvos-authorization was created just before removal, which points to commit google/GTMAppAuth@10d138e I have my own fork of that branch here. In my fork, I've deleted the rest of the GTMAppAuth code. This fork is not ready for use, but could serve as a starting point for moving this code into AppAuth. |
Integration ProposalHere's what I recommend we do. Now that the RFC 8628 is published, which specifies the device authorization grant and covers the tvOS use-case, it's a good time to integrate this code into AppAuth itself. In order to support tvOS in AppAuth, I suggest the following: 1. Move the code into AppAuthStart by moving the tvOS code formerly part of GTMAppAuth into AppAuth. Specifically, the classes:
As well as the example code in 2. Create a sub-specThis code should not be built for every user of AppAuth, but rather only those who want this support. Since this code is more than platform-specific user-agents, which in the AppAuth pod we just bundle with the relevant platforms, what I recommend in this case is to create a dedicated sub-spec, 3. Refactor for AppAuth
4. Update with spec-compliant RFC 8628 supportThe original implementation was made before RFC 8628 existed. It's mostly similar, but there are some fixes that need to be made:
You can reference the following patch WilliamDenniss/GTMAppAuth@463efbd for a very rough implementation of these changes. This patch can be a starting point, but will need to be cleaned up. Note that Google's implementation currently returns 5. Update the SampleThe sample should follow the approach that AppAuth takes by not hard-coding a specific IdP (currently they use Google), and instead having generic values, with a README describing how they should be set. |
Sounds good! |
I started a dev branch for collaboration on this. https://github.com/openid/AppAuth-iOS/tree/dev-tvos Work completed:
It builds, but I've not tested it. Over to you @soule! |
I think we've wrapped this up. Should we mark this closed? |
SGTM! |
I tried to use
Am I missing something? |
I found the error. The subspec for tvOS is only available starting from version |
Right now, there doesn't seem to be official tvOS support (at least the documentation isn't mentioning anything) even though the pod does compile on tvOS.
Since tvOS does not have a browser, how is an app supposed to use AppAuth here? Is it possible with the current AppAuth release or would changes be necessary?
As a side-note, we operate our own OpenID service.
The text was updated successfully, but these errors were encountered: