Java – Google server authentication code failed login

So I managed to use the new Google login to work

GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
            .requestScopes(new Scope(Scopes.DRIVE_APPFOLDER))
            .build();

mGoogleApiClient = new GoogleApiClient.Builder(this)
            .enableAutoManage(this /* FragmentActivity */,this /* OnConnectionFailedListener */)
            .addApi(Auth.GOOGLE_SIGN_IN_API,gso)
            .addApi(Drive.API)
            .build();

It works well, but now I need to send the authentication code to my server. The problem is when I send this line When requestserverauthcode (ClientID) is added to Google signinoption, login fails and useless status code is given. Status {statuscode = unknown status code: 12500, resolution = null} I have set OAuth and used the correct client ID. what may be the reason?

Solution

You should configure your Android client ID in firebase or Google console API, and provide keystore signature and your package name

Check the fingerprint of the keystore used to sign the APK Note that you may be using debug Keystore or release keystore If you are using Android studio, you can check in build type / signature

In most cases, this problem is related to the incorrect configuration of ClientID and serverid

To find your server ID, check the web client ID in the API console Also check if this ID is the ID you use on the back-end server

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>