Java Google Calendar API kullanarak bir takvime bağlanmaya çalışıyorum. Java uygulaması bir hizmet hesabı kullanır.Java Google Takvim Hizmet Hesabına Erişim "access_denied" Hizmet Hesabı
Ben ettik aşağıdaki kodu:
java.io.File licenseFile = new java.io.File("39790cb51b361f51cab6940d165c6cda4dc60177-privatekey.p12");
GoogleCredential credential = new GoogleCredential.Builder()
.setTransport(HTTP_TRANSPORT)
.setJsonFactory(JSON_FACTORY)
.setServiceAccountId("[email protected]")
.setServiceAccountUser(EMAIL_ADRESS)
.setServiceAccountScopes(CalendarScopes.CALENDAR)
.setServiceAccountPrivateKeyFromP12File(licenseFile)
.build();
client = new com.google.api.services.calendar.Calendar.Builder(
HTTP_TRANSPORT, JSON_FACTORY, credential)
.setApplicationName("Google Calendar Sync").build();
Calendar calendar = client.calendars().get(EMAIL_ADRESS).execute();
son satırda ben mesaj ile bir IOException olsun: Ben GoogleCredential nesnesi için değerleri kontrol dubble
ex = (com.google.api.client.auth.oauth2.TokenResponseException) com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request { "error" : "access_denied" }
ve Doğru olduklarından . Ben de üçüncü parti uygulama erişimi
Ben bir adım mi unuttum yetki istemci olarak uygulama kimliği ile alanım konsolunda https://www.google.com/calendar/feeds/, http://www.google.com/calendar/feeds/ ekledik?
Merhaba desteklemeyen izni sorunları ve hizmet hesapları beaware, bunu çalışmak var mı? Ben gmail kapsamı ile çalışıyor ama aynı hatayı alıyorum .. – zhywu
Ben cevap güncellendi;) –
Teşekkür, hizmet hesabı, selam – zhywu