How to get consumer key and and consumer secret for gmail api?

这一生的挚爱 提交于 2019-12-20 10:27:09

问题


I am trying to use Gmail php xoath php samples, however it requires to enter consumer key and consumer secret which I could not find how to obtain in Gmail api documentation. Does any one know how to obtain them or know of any related documentation?


回答1:


Use anonymous / anonymous and HMAC-SHA1 signature for applications that are not registered with Google. For applications registered with Google, you should use the application domain as consumer key and the consumer secret depends on the signing method (your private key for RSA-SHA1 and the secret generated during the registration for HMAC-SHA1). More details at Signing OAuth requests.

Note that as far as I know, HMAC-SHA1 for registered applications is supported only for applications installed by the Google Apps admins.




回答2:


In the google example to access to Gmail using IMAP & OAuth, you can find this code:

public static OAuthConsumer getAnonymousConsumer() {
return new OAuthConsumer(null, "anonymous", "anonymous", null);
}

Hope this helps



来源:https://stackoverflow.com/questions/4705988/how-to-get-consumer-key-and-and-consumer-secret-for-gmail-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!