Hybrid_Auth “Google returned an invalid response.” - hybridauth

HI I am using Hybrid_Auth , its working good but it has following problem in flow
$hybridauth = new Hybrid_Auth($config); $social =
$hybridauth->authenticate("Google"); //works When I call
$user_profile = $social->getUserProfile();//exception
It gives me this problem, Google returned an invalid response.

I found this issue by going to google console and enable google+ api
https://developers.google.com/+/web/api/rest/oauth

Related

com.google.android.gms.common.api.ApiException: 10

I'm trying to use google sign in sample, but it doesn't work. I receive ApiException statusCode = 10
I use the same code like here
https://developers.google.com/identity/sign-in/android/
This is two problems.
First, if you add ' .requestIdToken(getString(R.string.server_client_id))', you create web application Oauth2.0 in api console. try reading this 'https://developers.google.com/identity/sign-in/android/start' .
Second, if you not use 'requestIdToken', you create type is android Oauth2.0.
Second does not require a clientID but if you add code 'requestIdToken', need to add webapplication clientID.

Ola Android API issue

I am trying to integrate OLA api in android application
https://devapi.olacabs.com/v1/products?pickup_lat=12.9491416&pickup_lng=77.64298&category=mini
in header
X-APP-TOKEN: XXXXXXX
geting error message like below
{"code":"invalid_partner_key","message":"Partner key is not authorized"}
I am using link https://developers.olacabs.com/docs/ride-availablity
What is wrong?
Use https://sandbox-t1.olacabs.com/ instead of https://devapi.olacabs.com/ while making a ride availability api request
pass the X-APP-TOKEN as string use Key which identifies the partner this X-APP_TOKEN get from ola developer console after register

UserAddressRequest returning result code of 1 in onActivityResult when it worked earlier this week

I am using a UserAddressRequest in an android application to prompt the user to select an address with the following code.
if (HomeActivity.mGoogleApiClient.isConnected()) { // Google API is connected
// Building request for UserAddress
UserAddressRequest request = UserAddressRequest.newBuilder().build();
// Submitting the request for UserAddress object
Address.requestUserAddress(HomeActivity.mGoogleApiClient, request,
HomeActivity.REQUEST_CODE_RESOLVE_ADDRESS_LOOKUP);
} else { // Google API is not connected
if (!HomeActivity.mGoogleApiClient.isConnecting()) {
// Connect Google API if not connecting already
HomeActivity.mGoogleApiClient.connect();
}
}
in my onActivityResult I am getting the correct requestCode but a result code of 1 which previously I was not obtaining (Was getting -1 and everything worked earlier this week). I have not changed anything in the code and now it is not working. Has anyone ran into this problem or have an idea of where to go from here?
I brought this up in an email to android support and they passed it on to someone from their team. I received a quick email saying that the problem was being looked into. Then the following week ( last week ) the call was working again as it should on android m again. I don't know if it was a problem on their end or not but it seems to be working normally again.

getting Google oauth authorization token from Android- return with invalid_scope/ Unknown error

I try to use Google oauth to authenticate users on my android app.
Then I would like to send it to my app server so it can connect at any time with Google calendar.
I tried to use
GoogleAuthUtil.getToken(getApplicationContext(), mAccountName, mScope);
Following this article:
https://developers.google.com/accounts/docs/CrossClientAuth
When I use it with scope
mScope = "oauth2:https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile";
I get a token, which is valid for an hour
But when I try to get an authorization code (so I can get a refresh token that is valid for longer time, using
mScope2 ="oauth2:server:client_id:{CLIENT_ID}.apps.googleusercontent.com"+ ":api_scope:https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile";
I receive either "invalid_scope" or "Unknown" exceptions.
What am I doing wrong?
EDIT:
OK, After creating a new app on google API console and adding plus.login to the scope I get a code, but for some reason my server can't resolve this token. When tying to resolve server gets an error about the redirection URL.
BTW, When I do the web flow with same parameters it works.
OK, found the solution, I expected Google to have a lot better documentation about working with Google Oauth and Android. A few things you have to know to work with Android and offline token
When you create google Client ID Don't create a service application before you create a web application
Must include https://www.googleapis.com/auth/plus.login in your scope
The weirdest, to resolve the one time authorization code on my server, I had to use the redirection URL from the Android client ID details (which doesn't even look like a url) and not from the Web client details on Google API console.
That scope string is only documented to work when passed to GoogleAuthUtil(), see http://developer.android.com/reference/com/google/android/gms/auth/GoogleAuthUtil.html, on Android. But it would be cool if it worked on iOS too; our infrastructure there is a little behind where we’re at on Android.
You just need to follow the correct steps/format for specifying the scopes. Find them here https://developers.google.com/android/guides/http-auth#SpecifyingScopes

Google plus client “An internal error occured” [duplicate]

This question already has an answer here:
“An internal error occurred” with integration of Google Plus Login
20 answers
Last day I started to receive "An internal error occured" while trying to sign user with Google Plus in my application, that I used well and have not changed. The code has not changed for a long time.
GmsClient returns
connect: bindService returned true for Intent { act=com.google.android.gms.plus.service.START }
service broker connected, binder: android.os.BinderProxy#40fdbd20
And right after that shows toast message "An internal error occured".
I tried to compile Google SDK+ samples and run on the same device but it shows the same error.
Maybe something changed in Google APIs?
My "internal error occur" solution:
Follow the demo of https://developers.google.com/+/mobile/android/getting-started
it create the PlusClient by
mPlusClient = new PlusClient.Builder(this, this, this)
.setVisibleActivities("XXXX/AddActivity", "XXXX/BuyActivity")
.setScopes("PLUS_LOGIN") // Space separated list of scopes
.build();
And in my own app, when I remove ".setScopes("PLUS_LOGIN")" and show as:
mPlusClient = new PlusClient.Builder(this, this, this)
.setVisibleActivities("XXXX/AddActivity", "XXXX/BuyActivity")
.build();
The error solved, wired!
This is too dumb but I have not found any information googling internet and groups.
But it solved replacing:
//static final String[] SCOPES = new String[] { Scopes.PLUS_PROFILE, PLUS_WRITE_MOMENT };
static final String[] SCOPES = new String[] { Scopes.PLUS_PROFILE };
Seems the error occured because of PLUS_WRITE_MOMENT...
I don't understand why, but without this it works.
I like google...
I also had this problem, which suddenly appeared out of nowhere seemingly. Unfortunately, Oleg's answer didn't help me.
The fix for me was to setup OAuth in the Google APIs Console (https://code.google.com/apis/console). It was very easy to setup. Quickstart instructions here: https://developers.google.com/+/quickstart/android.
When I first created the project the Simple API Access worked. But, within a month of not changing any code, it wasn't enough.
My experience / solution:
I tried everything listed above (checking client id, consent screen, changing scopes, etc.). Nothing solved the issue for me permanently.
When I viewed the detailed adb logs using this:
adb shell setprop log.tag.GooglePlusPlatform VERBOSE
I got the following log:
I/GLSUser ( 854): GLS error: BAD_REQUEST xxxxx#gmail.com oauth2:profile https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/plus.me https://www.googleapis.com/auth/contacts.readonly
Finally, what did solve the issue was moving from PlusClient (which is deprecated) to using GoogleApiClient.
Migration is pretty simple (explained nicely here: http://www.riskcompletefailure.com/2014/02/migrating-from-plusclient-to.html).
After moving to GoogleApiClient, I never got this error again.

Resources