Why do my Android app get an Unknown Source Exception requesting short-lived authorization code in Google OAuth 2.0 flow? -


We have a project consisting of the Android app and web back-end, and as such it is registered in Google Console. The Android app is authorizing the user with their Google account (Google OAuth 2.0 Flow)

We have been able to obtain an access token for accessing Google APIs. (The scope is: "oauth2:" + SCOPE_PLUS_LOGIN + "" + SCOPE_EMAIL + "" + SCOPE_PROFILE) "

We are successful in obtaining an ID token, that the app can extend back-end too. (Scope: "Audience: Server: Customer_ID:" + SERVER_CLIENT_ID)

The problem occurs when we ask for a short-term authorization code (required for offline access to back-end). GoogleAuthException: Unknown (unknown source) at com.google.android.gms.auth.GoogleAuthUtil.getToken.

We know two things:

  • The scope OK, because we have already tested the permissions and web_client_id in the case of login token and ID token. "Oauth2: server: client_id:" + "SERVER_CLIENT_ID" + ": API_SCOP:" + SCOPE_PLUS_LOGIN and syntax are described here: To get offline access for back-end.

  • The source code is okay, because it has the same source code in case of access token and ID token (where it is full Works the way), only the radius is different. :

    What could be the reason that the short-term authorization code will not be returned, though there are two others? In some other questions, somebody suggested that getting the short-term authority code stopped working for them too. Could it be that it is no longer available or that the SH in the specifications has changed recently? First of all, make sure your Android app is registered in the Google Developers Console if you only sign your release signature.

    The keys are registered with the hash but if you are using a debug key for testing, then the Android app is identified as unregistered. Are all your signature keys registered? Second, make sure that the overlay IDs for your Android app and web server are in the same Google Developer Console project, cross-client authentication is permitted only for auth parties in that project.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -