google drive api error 403 Access Not configured

2019-01-29 11:27发布

问题:

I am developing an Android app which uses drive sdk to upload an image. After spending yesterday hours on setting up the api access and getting the upload to work (i got always the same error 403 Access not configured), today at work on an other computer, the i get this error again.

I have turned Drive SDK and Drive API on and yesterday the error disappeared after turning Cloud Storage API on. This is also very weird because I nowhere Google says that this should be on.

I also tried to create a new client id with a fingerprint from this workstation, which also doesn't help.

Any idea?

回答1:

Under your Google API Console>API Acess, do you have the right settings for Android here is and example, Especially check the package name:

Client ID: 6756856856-lv3w3qw268df7235w3twtw3tqwq3fg4l3gdi.apps.googleusercontent.com

--Redirect URIs: urn:ietf:wg:oauth:2.0:oob http:/localhost

--Application type: Android

--Package name: com.l2c.grants+

--Certificate fingerprint (SHA1): 22:22:22:22:22:1A:05:81:22:CB:22:22:06:22:2222C:7B:22:22

--Deep Linking: Disabled

Where is this error occuring, is it after the user clicks the link to sign in to google, or after they have signed in and your app is uploading the file?



回答2:

Configure Eclipse to use the same debug keystore on all your pc's (google: custom debug keystore), and register that new key on the APIs Console.

Optionally, if you already have Android apps on the AppStore, you can generate a debug keystore from your production key, so that their SHA1 key will be the same.