How to use Google API Keys

Source: Internet
Author: User
Tags auth oauth
API Keys
Some features of Chromium use Google APIs, and to access those APIs, either a API Key or a set of OAuth 2.0 the IS tokens Uired. These instructions apply to Chromium version and higher.

You can specify the API keys to use either when you build Chromium, or at runtime using environment variables. The need to acquire keys for yourself.
The keys you acquire are a not to distribution purposes and must not being shared with other users.
acquiring Keys Make sure your are a member of chromium-dev@chromium.org (for you can just subscribe to Chromium-dev and choose does not receive Mail). For convenience, the APIs below are only visible to people subscribed to that group. Make sure your are logged in with the Google account associated and the email address this you used to subscribe to Chromi Um-dev. Go to Https://cloud.google.com/console Click the Red Create Project ... button. (Optional) You could add other members of the your organization or team to the Team tab. In the ' APIs & Auth ' > APIs tab, click the On/off button to turn each of the following APIs to the "on position, and Read and agree to the Terms of Service, is shown: (This list might being out of date; try searching for APIs starting WI Th ' chrome ' or having ' for Chrome ' in the name. Chrome Remote Desktop API Chrome spelling API Chrome suggest API Chrome Sync API Chrome Translate Element Google Maps Geol Ocation API (requires enabling billing but is free to use;E, in which case geolocation features of Chrome won't work) Safe browsing API Speech API time Zone API Google Cloud Mes Saging for chrome Google today for Chrome APIs (Optional, enabled to show Google now cards)
Google + API (Optional) If you are doing Chrome OS work your may also want:chrome OS hardware ID API
Chrome OS Registration APIIf Any of the APIs are not shown, recheck Step 1.Go to the Credentials tab under the APIs & Auth tabs. Click the red Create New Client ID button in the OAuth section to Create an OAuth 2.0 client ID. You want ' installed application ' for the Application type section you want ' other ' for the installed application type sect Ion A new box should now appear titled "Client ID for installed applications". In the next sections, we'll refer to the values of the "Client ID" and "Client Secret" fields into this box later (below). Click the Red Create new Key button in the public API Access section and Create a new Browser Key. You are want to leave the box on the "Create a browser key and configure allowed Referers" empty. A new box should appear titled "Key for Browser Applications". The next sections'll refer to the value of the "API key" field too. Note This keys you have now acquired are is not a for distribution purposes and must is shared with other users.
providing Keys at builds timeIf you are are building Chromium yourself, you can provide the keys as part of your builds configuration, that way they are Baked into your binary. To doing this, specify a few variables to Gyp (there are three the "do" this; One easy way are to create, or edit, the file ~/.gyp/include.gypi (or C:\Users\yourusername\.gyp\include.gypi if you ' re on Windows), with contents like the following:

{
' Variables ': {
' Google_api_key ': ' Your_api_key ',
' google_default_client_id ': ' your_client_id ',
' Google_default_client_secret ': ' Your_client_secret ',

# ... other variables your may have ...
},
}

Where the text "(Your Api_key)" is replaced with your Api_key value, and so forth.

Once you for ' ve done this, run gclient sync or gclient runhooks, and your builds after that'll use your keys.
The "above is" equivalent to providing more flags gyp, i.e. build/gyp_chromium-dgoogle_api_key= ' ... '-dgoogle_def Ault_client_id= ' ... '-dgoogle_default_client_secret= ' ... '.
Depe nding on the way your build Chromium and the latter may is more practical for you.providing Keys at RuntimeIf you are prefer, can build a Chromium binary (or use a pre-built Chromium binary) without API keys baked in, and instead provide them at runtime. To does so, set the environment variables Google_api_key, google_default_client_id and Google_default_client_secret to your "API key", "Client ID" and "C lient SECR et" values respectively.getting Keys for Your Chromium derivativeMany of the Google APIs used by Chromium code are specific to Google Chrome and don't intended for use in derived products. In the API Console (http://developers.google.com/console) Your May is able to purchase additional quota for some of the AP  is listed above. For APIs ' do not have a ' Pricing ' link, additional quota is isn't available for purchase.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.