Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle OAuth not working on iOS
    text
    copied!<p>Trying to get my head around OAuth 2.0. I am building a cross platform google drive app using PhoneGap Build and JQM. </p> <p>I am able to format the request URL correctly and on both iOS and Android. It prompts the user for ID/PW using InAppBrowser (tried child browser too). Next user gets prompt with blue button on web page to "Allow Access" just like on other google web sites/apps. On Android all is well user taps allow access and callback finds the success code and I can grab the token. On iOS I get a "Load Error" message in the status bar of InAppBrowser but I can't trap the error to see what it is. It seems as if the redirect parameter breaks things before the startLoad or endLoad event can be called to trap success/failure in the response from Google.</p> <p>Playing with oauth2-playground my URL looks correct and like I said it is working fine on Android. </p> <p>Anyone have any ideas what differences I need to look at with regard to iOS? Been stumped here for a couple of days. Any and all help greatly appreciated.</p> <p>I have tried redirecting back to http//localhost and http//localhost/afterOauth.html where afterOauth.html is a page in the app to give the redirect something to call the startLoad/endLoad event.</p> <p><strong>Update</strong>: I really think the problem has something to do with the redirect I give the original Google request. If I change "localhost" to urn:ietf:wg:oauth:2.0:oob which shows up in the google documentation both Android and iOS behave the same. They take me to a page saying "Please copy this code, switch to your application and paste it there" With the code=4/MyCode below it.</p> <p>Also, I added a loaderror callback. It does not fire on Android but does on iOS giving error code -1004 and error message: could not connect to the server. However in the event.url of this loaderror it clearly shows the code=4/myCode. What is the missing link here for iOS and successful OAuth between Google? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload