Google Calendar API access not configured

2020-07-19 05:51发布

问题:

I've downloaded a sample project from here: http://code.google.com/p/google-api-java-client/source/browse/calendar-android-sample/?repo=samples

I performed all the steps as described except that retrieved the SHA1 key using the Keytool plugin for Eclipse. When I run the app on my phone however, it shows an Access not configured error message The following is from the LogCat:

com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
 "code": 403,
   "errors": [
     {
       "domain": "usageLimits",
       "message": "Access Not Configured",
       "reason": "accessNotConfigured"
     }
  ],
   "message": "Access Not Configured"
 }

I have created a project in google console, enabled the calendar APIs, created an OAuth2 Client ID, used the SHA1 key from Eclipse and have not seen any error maessages. I can't see a client secret in the console though. Do you have any idea what is missing?

These are the permissions from the Android Manifest, in case you're wondering.

enter code here


<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />

I'm new to using the calendar APIs would like to see this app work before creating my own. Also, I suspect this might become an issue in the future as well.

回答1:

Access Configuration needs to be performed using the Client API. See the links in the left column.

Since you have to specify scope when asking for user authorization, this effort seems redundant. But necessary nonetheless. http://www.tqis.com/eloquency/googlecalendar.htm