Google Sign in not working after first time - ios

So, I have an iOS app that allows the user to login via Google. From the look, it seems Google changed the login design (just that the screens look different).
However, I did not change any code for Google Login. It was working just fine till yesterday.
But now, I am able to login to my app through Google Login for the first time. But when I log out and try to do the Google login again, the WebView is just blank. There is no sign of the login page loading.
So, is there any new code snippet that needs to be added?
I am using swift language.
Apparently I found this thread: Google Sign In not working on iOS 10 Beta 7 with Xcode 8 beta 6
which is the exact issue I am facing. I tried the steps mentioned there too.
The interesting thing is that, we have a Google Signup and Login option separately and both are doing the same thing.
While login does not work after the first time, Sign up is working fine. No problems with that. Both the functionalities have same code too.
Let me know if you require any additional details from me for helping me out!

Related

Facebook log in keep redirecting in iOS

I have an Unity application using Facebook SDK for user to link their account. Everything works in Android. But in iOS, the login page keep redirecting to the previous page which asking me to login even I press "Continue".
https://youtu.be/nGs8jiaI24s
I have found that there is a post asking the same question. But the solution does not work for me.
Unity Facebook SDK is keeping on asking me to confirm login every time I login to my game
In my case, FB.IsLoggedIn return false so loginWithReadPermission is still being called and user fall in the loop between login and continue.
Are there any method to solve it, or at least get the error message?

Trouble logging in Instagram using "Login with Facebook" option

I implemented Instagram Login using Basic Display API. Everything works fine if the user enters their Instagram credentials in the web view that comes up on loading https://api.instagram.com/oauth/authorize request. After that I can pull the user's media from the Instagram account. It tells me that everything is implemented properly.
Now, if user choses the "Log in with Facebook" option in the WebView and goes through the Facebook login flow, everything still works fine when I run it on a simulator: after Facebook finishes its login flow with 2 factor authentication I eventually get the redirect callback, parse the code form it and all the rest works as normal.
But the same fails on a physical device. After I call https://api.instagram.com/oauth/access_token to get the token with the obtained code the Instagram app launches momentarily and then opens Safari with this error:
{"message":"Logged-in use not
supported","status":"fail"}
What gives? This is incredibly frustrating, one day was wasted and not sure where to go from here. Any ideas?
UPDATE:
The reason it behaves differently on the device is because it has Instagram app installed and the app gets launched when Facebook calls https://www.instagram.com/accounts/signup/... endpoint to return to the Instagram auth flow (I am watching the requests coming through the WkWebView). Instagram app throws that error above, while on the simulator the end point seems to be serviced fine by the Instagram backend and the flow continues as it should.
So the question is how to get the Instagram app out of the loop.
UPDATE2:
Confirmed - once I deleted the Instagram app from the device it works as expected. Once I install it back it gets launched again during the authentication flow by Facebook and the problem is back. This seems to be a bug in the Instagram app, I have no other explanation.
OK, so after lots of dead ends and obscure rabbit holes I was frantically going down, I have concluded that the real issue is the bug in the Instagram App. As noted in the update to my question the flow started to work fine after I removed the Instagram.
Still not ready to jump to conclusions I tried a few other apps from the Appstore that have Connect to Instagram feature. All of them fail exactly the same way. Specifically if you choose "Continue with Facebook" on the Instagram login WebView you eventually end up launching Instagram app (if it's installed) which in turn throws an error in Safari, and you are stuck.
And you know what the funniest thing is? If you download the Instagram app itself and try to login using the same Facebook flow it will fail as well!
The lesson learned - before you suspect you made a mistake in your implementation check out some other apps with the same feature implemented and maybe you'll discover that you are not alone in your struggle.
The documentation says you should send a POST request to this URL:
Step 2: Exchange the Code For a Token
Once you receive a code, exchange it for a short-lived access token by
sending a POST request to the following endpoint:
POST https://api.instagram.com/oauth/access_token
I didn't get why are you trying to redirect users to this endpoint?

Google Plus not able to redirect to application after sharing in iOS

the issue is in sharing of some thing using google plus in iOS application. the login works fine of google plus in my and google provided demo.
when i implemented it back 2 months it worked fine but suddenly i checked it today it gives error.
1) when i try to share some thing it redirects me to safari as expected. in both case when i am trying to login.
2)but when i press share button it shows sharing dialogue and after that it redirect to new page and error comes like "about:invalid#zClosurez"
3)but when it opens safari for login and i authorise app and it redirect me to my app back perfectly.
4)sharing is working fine the things that user wants to share is shared but it does not redirect back to my app.
https://code.google.com/p/google-plus-platform/issues/detail?id=794&can=8&colspec=ID%20Type%20Status%20Component%20Owner%20Summary%20Stars
click for detailed question
Thanks in advance
This was a bug Google's side with the page that was redirecting the user back - it was fixed in a release this week, so you shouldn't see the issue any longer.

Facebook Canvas App Login URL doesn't look like other logins

So this is a canvas app, intended to run in the FB chrome.
I'm using the FB php SDK.
I'm creating my login url by:
$loginUrl = $facebook->getLoginUrl( array('scope'=>'email,publish_actions', 'redirect_uri'=>$fbCanvas));
then using this script to redirect:
print "<script> top.location.href='" . $loginUrl . "'</script>";
Instead of seeing a "regular" fb app auth dialog, such as:
What I want to see
I get a dialog like this one:
What I see instead
Any ideas what I'm doing wrong?
If the new user clicks on the Okay button, they are logged into the app, redirected correctly and everything works ok, I just want it to look like / work like every other app.
Thanks!
Facebook is re-styling the Login dialog (again), see https://developers.facebook.com/docs/concepts/login/permissions-login-dialog/#login-dialog
As usual with Facebook, this rollout does not affect all users or all apps at the same time, but is gradually rolled out. So for a while users might see both versions of the login dialog, but eventually all apps will use the new one.
You are doing nothing wrong.
I suspect Facebook has changed the way it displays the Authorization/Permission window depending on the data available for the Application. If your application lacks 'App Detail', 'Image' , 'Privacy Policy Link' etc. then you get the authorization window as What major apps show else you would get the window you are getting right now.
Earlier there was no distinction as such but since this month it might have changed as I earlier used to get the full fledged Authorization window but not now.

Has Google pushed an update to their OAuth2.0 flow that breaks multiple accounts?

Up until last week, when ever I was logged into multiple accounts in Google and I invoked the OAuth2.0 flow I would get to an ugly screen (looked like it had been hit repeatedly with the ugly stick) that was functional. It would display a list of radio buttons with all the accounts I am logged in as, you select the one and continue through the flow.
This week I now get a beautiful screen that is non-functional (does not list accounts and the signin button only adds an additional account to the list of accounts I am signed in as) I should point out that I am logged into 4 different Google accounts at the same time. The OAuth2.0 for my app appears to be working fine as if I start an in-cognito window in Chrome, or start a new session and only have one account logged in, my OAuth flow continues normally.
Is this just me or is everyone hit by it?
We (google) are rolling back the new page and within a few minutes it should return to the previous behavior.
Any chance you could let us know what kinds of accounts those 4 you were logged in to were? SAML? Google Apps? Plain gmail?
We're also experiencing this. Hope someone at Google takes note and gets this fixed soon!
EDIT: To clarify, I've only experienced the problem when logged into both a personal Google account AND a Google apps account. Haven't tested other situations at present.
FYI, we just rolled out the new UI, so you may begin to see the "beautiful screen" that is now functional. :-) Thanks for the bug report.

Resources