Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Blank page - stored credentials iOs social login #31

Closed
gregor-srdic opened this issue May 15, 2017 · 16 comments
Closed

Blank page - stored credentials iOs social login #31

gregor-srdic opened this issue May 15, 2017 · 16 comments

Comments

@gregor-srdic
Copy link

I am using this lib to add auth0 authentication (google, facebook, database) to Ionic1 application. With plugins, it now works OK on Android, but on iOS, when user has previously logged in with Gmail account, the popup is stuck on blank page, and no tokens are returned to the Ionic app.
http://i.imgur.com/lQjUI6n.png
Any idea, what I could be doing wrong?

@darkyen
Copy link
Contributor

darkyen commented May 15, 2017

Can you check if the "Client Type" is selected as "Native" in Dashboard > Clients > Your Client Name > Settings

@gregor-srdic
Copy link
Author

Thanks. It is not, I am not sure if I can change that on the old client (currently running in production :( ), will certainly do on the new one. Hopefully it will solve the problem, though I don't really see how that is connected :) The problem only appears on iOs and only when client has been logged in with the same social provider before.

@hzalaz
Copy link
Member

hzalaz commented May 17, 2017

@gregor-srdic in iOS does it work when the user is not previously logged in?

If not, please check that you installed the plugins detailed in the README correctly. Since cordova plugins tends to be a bit brittle I'd recommend removing the iOS platform and re-adding it.

@gregor-srdic
Copy link
Author

gregor-srdic commented May 18, 2017

yes, if I reset the simulator (delete all settings) I can login the first time with google account. Then if I log out, and even if I remove the app and reinstall it, it gets stuck on the blank page :S
I am now testing with Native auth0 client, I have set team id and bundle id in client settings, but nothing seems to help.

@gregor-srdic
Copy link
Author

after more research I found out that if I sign out of my google account in safari, I can login in cordova app again, first time.
And further, cordova app sign in always works if i sign into two or more google accounts in safari.
Therefore this must be an issue with automatic login with google account that occurs if user has previously logged in with single google account.

@gregor-srdic
Copy link
Author

update: we checked the auth0 log and there is a record of a successful login
therefore, this must be a problem when safariViewController tries to automatically redirect back to the app, when credentials are already available.

@gregor-srdic
Copy link
Author

Does anyone have anything to add to this? It seems painful to ask users to delete safari cookies and web data every time they log out and want to log back in :S

@MT--
Copy link

MT-- commented May 25, 2017

SafariViewController does not dismiss and callbacks are not running. The logs in the Auth0 dashboard show successful logins and signups.

img_0018

@gregor-srdic
Copy link
Author

gregor-srdic commented May 26, 2017

@MT-- based on the screenshot your problem does not seem the same, I would say you have a problem with callback to the application. Perhaps you should try removing and re-ading the cordova-plugin-customurlscheme plugin and be careful about lower case like #38

@gregor-srdic
Copy link
Author

my situation stops at this
done

@gregor-srdic
Copy link
Author

Further research: Also if I revoke access to the application in google/facebook account, I can normally log in once again.

@gregor-srdic
Copy link
Author

Further research thanks to a colleague revealed, that window.handleOpenURL method was also being invoked when the popup window showed a blank web page.
With some experimenting I was able to find the solution, which is a timeout in handleOpenURL function.

window.handleOpenURL = function (url) { 
window.setTimeout(function () {
PKCEClient.onRedirectUri(url); 
}, 100);
}

@nitinchangwal
Copy link

nitinchangwal commented Jan 12, 2018

In phonegap build the same issue occurred for me.
SafariViewController does not dismiss and callbacks are not running. The logs in the Auth0 dashboard show successful logins and signups.
I tried setTimeout function in window.handleOpenURL but it is not work for me.
i tried deeplink plugin instead of color schema url also.

@anacesponda
Copy link

Hi @gregor-srdic I'm having the same problem that you were having. Fb is working fine but when trying to sign in with Gmail, the first time it's 👌 , but once the user is logged it shows me the Website Name. I tried with your solution but still not working. Do you have any news about it?
Thanks

@GODBS
Copy link

GODBS commented Aug 2, 2019

I have the exact same issue :(

@jwmann
Copy link

jwmann commented Aug 13, 2019

I was able to temporarily solve this for iOS by 'Erasing all Settings and Contents' from the Simulator and running the emulator again from scratch.

Must be some kind of cache that somehow persists even after you quit the simulator?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants