android / identity-samples

Multiple samples showing the best practices in identity on Android.
Apache License 2.0
380 stars 227 forks source link

Unexpected response code 400 #1

Open codingjeremy opened 5 years ago

codingjeremy commented 5 years ago

Issue by g123k Friday Jun 05, 2015 at 12:58 GMT Originally opened as https://github.com/googlesamples/android-credentials/issues/3


When I try to save the credentials for the first time, I have this message in the logcat:

E/Volley  ( 1070): [250] BasicNetwork.performRequest: Unexpected response code 400 for https://www.googleapis.com/credentials/v1/credentials?alt=proto&header.playServicesVersion=7571000&obfuscationKey=44838BE022CB8E787432945F2B755C422766B72D16B5DDB5CBD56C525143C8AE
E/CredentialsApi( 1309): Error when saving credential.
E/CredentialsApi( 1309): com.google.android.gms.auth.api.credentials.a: java.io.IOException: Server error.
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.d.a(SourceFile:329)
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.be.b.e.a(SourceFile:181)
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.be.b.e.a(SourceFile:33)
E/CredentialsApi( 1309):    at com.google.android.gms.common.service.g.run(SourceFile:178)
E/CredentialsApi( 1309):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E/CredentialsApi( 1309):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E/CredentialsApi( 1309):    at java.lang.Thread.run(Thread.java:818)
E/CredentialsApi( 1309): Caused by: java.io.IOException: Server error.
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.be.c.d.a(SourceFile:124)
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.be.s.a(SourceFile:95)
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.be.d.a(SourceFile:279)
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.be.d.a(SourceFile:92)
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.be.z.onTransact(SourceFile:135)
E/CredentialsApi( 1309):    at android.os.Binder.execTransact(Binder.java:446)
E/CredentialsApi( 1309): Caused by: com.google.android.gms.auth.api.credentials.be.a.c
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.be.a.b.a(SourceFile:469)
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.be.a.b.a(SourceFile:156)
E/CredentialsApi( 1309):    at com.google.android.gms.auth.api.credentials.be.c.d.a(SourceFile:117)
E/CredentialsApi( 1309):    ... 5 more

I don't think the error is on the client-side, but the Intent in the onActivityResult is empty.

codingjeremy commented 5 years ago

Comment by samtstern Friday Jun 05, 2015 at 15:30 GMT


@g123k can you show me the code you are using to save credentials? Also have you created a client ID in the Google Developers Console?

codingjeremy commented 5 years ago

Comment by g123k Friday Jun 05, 2015 at 15:50 GMT


Hello,

I'm using the code from this git. What do you want exactly? And yes, I have a working client ID (the Google sign-in is OK).

codingjeremy commented 5 years ago

Comment by ValleZ Tuesday Jun 30, 2015 at 19:14 GMT


Hi, any progress here? I see same behavior. What's interesting is that onActivityResult has Activity.RESULT_OK, but in fact the credentials aren't saved.

codingjeremy commented 5 years ago

Comment by samtstern Tuesday Jun 30, 2015 at 20:49 GMT


@ValleZ when you get RESULT_OK are there any errors in the logs?

codingjeremy commented 5 years ago

Comment by ValleZ Tuesday Jun 30, 2015 at 21:46 GMT


Yes, the very same stacktrace - Unexpected response code 400

codingjeremy commented 5 years ago

Comment by malcolmmaima Thursday Mar 14, 2019 at 07:20 GMT


if building app in a new/different machine then you'll probably need to add a new SHA1 code on Firebase

dsnykaa commented 4 years ago

Any update on this issue? Solution?