Google Plus not able to redirect to application after sharing in iOS - 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.

Related

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?

iPhone OAuth login request redirects to App not Browser, doesn't work

My current scenario is:
Running an iPhone on the latest iOS
LinkedIn App is installed and logged in
Web browser is NOT logged into LinkedIn (because I have the app)
Developing a web app with "log in with LinkedIn" functionality
On the iPhone, clicking the "log in with LinkedIn" button redirects me straight the the LinkedIn App, which subsequently does nothing - just shows me my feed. I have verified this same behaviour occurs on a third-party site as well as my own. Note that Android exhibits similar behaviour, though I haven't tested as extensively there.
I've found several workarounds:
If I open the web site in Private Browsing mode clicking the login button asks me if I want to open the App or stay in the browser.
If I long-press and "Open in background tab" the login button it'll open (in the background, of course) instead of redirecting to the app, allowing me to log in.
If I manually type "linkedin.com" into the browser and log in then it seems to work too.
None of these are even vaguely practical for end users, essentially forcing us to remove the option entirely.
I'm fairly sure this is a problem at LinkedIn's end and the solution is either:
Don't redirect to the App for OAuth Authorize requests, or
Make the App correctly handle OAuth Authorize requests.
If I'm incorrect and there's some way we can stop this redirect from the client side I'd be happy to hear, otherwise I hope LinkedIn engineers actually see this...
See the comments in Issues with Linkedin Social connection
LinkedIn already confirmed that it is a problem on their side.

iOS app using OAuth2 with Google and Safari presents open page dialog

I have finally got my iPhone app to authenticate and return back to my app with the authorisation code. The main problem was that the reverse client id did not get picked up by my app. I had to add an url scheme of my bundle id instead of the reverse client id.
Anywho, the problem is post authenticating in Safari I am presented with a open 'app name' page dialog. If the user clicks open it works fine. If they leave it for just a few seconds it redirects them to the Google homepage and they have to start all over again. If they are using two factor authentication by any other method than phone call I think it fails too.
How can I avoid this open page dialog?
The solution I found was to use the official Google library for iOS. This does not involve Safari like the AeroGear library I was using does.

Google Sign in not working after first time

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!

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.

Resources