-
Notifications
You must be signed in to change notification settings - Fork 9
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
AppAuth not working on certain versions of iOS #30
Comments
Tried to reproduce on version 9.3 |
Errors in the console log. I am not sure if all of these are relevant.
It was stuck here forever and in the sign in screen of the open-to-all page forever.
|
Going to focus on the
line since that is where I observed it hanging. That line is actually from javascript.
So we are getting called back with the URL.
but we don't see the callback
|
The native plugin interface
|
It certainly looks like it. It looks like the
Dunno how it is supposed to be called. |
Ok, so this is 100% reproducible in the emulator as well. I used a 9.2 emulator and tried to log in. Messages:
@Andrew-Tan, did you try on an emulator running an older version of iOS? |
If I run the exact same code against an emulator running 11.4, everything works and the log messages are:
Note that we do get the Note also that we don't get the |
Hi @shankari, I didn't run it in the older version because I think I'll get the same error as yours. I'm searching for this issue on the web and found this interesting article: https://medium.com/@jlchereau/stop-using-inappbrowser-for-your-cordova-phonegap-oauth-flow-a806b61a2dc5 Could you take a look? |
@Andrew-Tan do you know the mechanism by which the AppAuth library gets back the accessToken? I assumed it was that the But I just added a breakpoint to
and it didn't trigger when running on a 11.4 emulator. |
Ah, in iOS10, the signature for
|
In general, for example, the url emission.auth://oauth2redirect?state=n_XnEhZM6d3VNPvOQutFVve3zwtra6oQ6e6Gm-W-fAA&code=uss.cT8CftoN2_Ft527TPuR9qdh1W7sL8F9JbJxIdM0FZ1I.5f575a3f-13d3-4f82-a907-9a858a010b12.29327dfe-bbca-4681-887b-c8c40f3f2ae9 should be passed down to the AppAuth library, and it'll use the code to negotiate access token with the auth server. |
@Andrew-Tan yeah but it should be passed down by calling |
@Andrew-Tan ok I know what is going on.
Note that for iOS version 11+, the library does not use the URL redirection for the callback. Instead, it specifies a This is the flow that you tested, and it works. For iOS 9 -11, though, it opens safari directly with the request URL - there is no
In this case, once the authentication is complete, Safari navigates to the redirect URL, with protocol I don't see the I am not sure what AppAuth recommends for handling the callback URL in iOS 9 - 11. However, from an e-mission perspective, if you implement |
@Andrew-Tan looking at the You should be able to test your changes by using an emulator running an older version. |
wrt #30 (comment), I read the article and it looks like what Note that at the end of that post, they say that you need to Note that while testing on iOS 9.2, I got the following message (#30 (comment), #30 (comment)). So
|
@Andrew-Tan Sorry for the push, we have participants in the study who are ready to go! |
@Andrew-Tan @uwtcat note that after Andrew makes the fix, because it is a native code change on iOS, it also requires passing through app store review, which can take upto a week. Current app store review time average is 3 days. |
@shankari How can I get the redirect URL from NSNotification? |
@shankari Nevermind... I've figured it out. Just made the change and created a pull request. |
While testing this in a build that also included a fix for https://github.com/e-mission/e-mission-phone/issues/443, I ran into a several issues with ionic deploy - the feature that allows us to "skin" the UI efficiently on older versions of iOS (iOS 9, iOS 10). When I filed an issue with ionic, the response was to point me to https://github.com/e-mission/e-mission-phone/issues/443, which says that
I am going to revert to the old version of ionic while the community debates what to do about versions. @uwtcat I will publish a new build on TestFlight today. |
Ok, so I reverted to the old version of ionic deploy and tested on iOS 9.2, iOS 10.2 and iOS 11.4. In all cases, the app was installed correctly, the UI-only update was deployed properly, and I got to the screen to log in to the AppAuth server. Unfortunately, https://accounts.open-to-all.com/ currently has a gateway error, so I can't test further. However, I have uploaded a new version (1.0.4) to TestFlight. @uwtcat and @Andrew-Tan you can test this version over the weekend. Please update this issue with your findings... |
Fixed in #31 |
@uwtcat @Andrew-Tan Very surprisingly, the update went through app store review in one day. Maybe they are catching up with their backlog after labor day weekend? You can resume beta testing...
|
Got a report from the TCAT folks that the AppAuth-based authentication is not working on certain versions of iOS.
Works on certain others.
Reported to not work on
10.2.1
The text was updated successfully, but these errors were encountered: