OAuth2.0 token strange behaviour (Invalid Credentials 401)

Per the Google API docs on errors & error codes: https://developers.google.com/drive/handle-errors#401_invalid_credentials 401: Invalid Credentials Invalid authorization header. The access token you’re using is either expired or invalid. error: { errors: [ { “domain”: “global”, “reason”: “authError”, “message”: “Invalid Credentials”, “locationType”: “header”, “location”: “Authorization”, } ], “code”: 401, “message”: “Invalid Credentials” } } This matches your … Read more

Error: invalid_request device_id and device_name are required for private IP

An alternative to editing a hosts file is to use the “Magic DNS” service https://nip.io/ nip.io is a magic domain name that provides wildcard DNS for any IP address. Say your LAN IP address is 10.0.0.1: 10.0.0.1.nip.io resolves to 10.0.0.1 (dot syntax) 192-168-1-250.nip.io resolves to 192.168.1.250 (dash syntax) 0a000803.nip.io resolves to 10.0.8.3 (hex syntax) foo.bar.10.0.0.1.nip.io … Read more

How to correctly use Google Plus Sign In with multiple activities?

Reconnecting for each activity is absolutely fine. Broadly there are 3 ways I’ve seen of people implementing this: Implement mostly in a baseactivity, and have the others extend that. This is connect/disconnect in each activity, but with code in only one place. Implement connect/disconnect in a fragment, and include that in activities where auth is … Read more

The signing fingerprint you specified is already used by another Android OAuth2 client

This error occurs when there is an existing SIGNING CERTIFICATE FINGERPRINT (SHA1) on Google Developers linked to a different account. Solution is to delete the project that is using that SHA1 in console.developers.google.com for the old/incorrect project. You cannot change the SHA1 fingerprint once it is set. Remember that deleting the project takes 7 days … Read more

Google OAuth 2.0 failing with Error 400: invalid_request for some client_id, but works well for others in the same project

Please see https://stackoverflow.com/a/71491500/1213346 for a “proper” solution. This answer is just an ugly workaround that the community seems to like. … Here is a cringy workaround for this situation: Replace urn:ietf:wg:oauth:2.0:oob with http://localhost:1/ in the code posted in the question. This makes the flow go through, my browser gets redirected and fails and I get … Read more