Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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?

like image 953
khr2003 Avatar asked Jan 16 '11 14:01

khr2003


People also ask

What is API consumer key?

View Apigee Edge documentation. An API key (known in Apigee as a consumer key) is a string value passed by a client app to your API proxies. The key uniquely identifies the client app. API key validation is the simplest form of app-based security that you can configure for an API.


2 Answers

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.

like image 178
Franci Penov Avatar answered Oct 21 '22 09:10

Franci Penov


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

like image 38
4lberto Avatar answered Oct 21 '22 09:10

4lberto