Google app engine 如何在java中使用oauth访问google联系人
以前我可以使用消费者密钥和消费者机密访问谷歌联系人Google app engine 如何在java中使用oauth访问google联系人,google-app-engine,google-shared-contacts,Google App Engine,Google Shared Contacts,以前我可以使用消费者密钥和消费者机密访问谷歌联系人 GoogleOAuthParameters objParametersPro = new GoogleOAuthParameters(); ContactsService contactService = new ContactsService("App_Name"); objParametersPro.setOAuthConsumerKey(m_sConsumerKey); objParametersPro.setOAuthConsumer
GoogleOAuthParameters objParametersPro = new GoogleOAuthParameters();
ContactsService contactService = new ContactsService("App_Name");
objParametersPro.setOAuthConsumerKey(m_sConsumerKey);
objParametersPro.setOAuthConsumerSecret(m_sConsumerSecret);
objParametersPro.setOAuthType(OAuthType.TWO_LEGGED_OAUTH);
OAuthSigner objSignerPrp = new OAuthHmacSha1Signer();
objParametersPro.addCustomBaseParameter("xoauth_requestor_id",adminEmail);
contactService.setOAuthCredentials(objParametersPro, objSignerPrp);
contactService.setHeader("GData-Version", "3.0");
try {
String url="https://www.google.com/m8/feeds/contacts/"+domain+"/full/"+contactId;
entry = contactService.getEntry(new URL(url),ContactEntry.class);
} catch (Exception e1) {
e1.printStackTrace();
log.warning("exception in create entry obj"+e1);
}
但是现在我不得不使用OAuth2.0。任何人都可以得到它的示例或一段代码吗?我在下面看到错误com.google.gdata.util.ResourceNotFoundException:OK错误404(未找到)!!1404。那';s错误。在此服务器上找不到请求的URL
/m8
。那';这就是我们所知道的。。我已经将联系人url添加到范围中。我错过了什么?谁能告诉我我错过了什么。。?