OLD | NEW |
1 <h1>Tutorial: OAuth</h1> | 1 <h1>Tutorial: OAuth</h1> |
2 | 2 |
3 | 3 |
4 <p> | 4 <p> |
5 <a href="http://oauth.net/">OAuth</a> is an open protocol that aims to standardi
ze the way desktop and web applications access a user's private data. OAuth prov
ides a mechanism for users to grant access to private data without sharing their
private credentials (username/password). Many sites have started enabling APIs
to use OAuth because of its security and standard set of libraries. | 5 <a href="http://oauth.net/">OAuth</a> is an open protocol that aims to standardi
ze the way desktop and web applications access a user's private data. OAuth prov
ides a mechanism for users to grant access to private data without sharing their
private credentials (username/password). Many sites have started enabling APIs
to use OAuth because of its security and standard set of libraries. |
6 </p> | 6 </p> |
7 <p> | 7 <p> |
8 This tutorial will walk you through the necessary steps for creating a Google Ch
rome Extension that uses OAuth to access an API. It leverages a library that you
can reuse in your extensions. | 8 This tutorial will walk you through the necessary steps for creating a Google Ch
rome Extension that uses OAuth to access an API. It leverages a library that you
can reuse in your extensions. |
9 </p> | 9 </p> |
10 <p> | 10 <p> |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 'consumer_key': 'anonymous', | 82 'consumer_key': 'anonymous', |
83 'consumer_secret': 'anonymous', | 83 'consumer_secret': 'anonymous', |
84 'scope': 'https://docs.google.com/feeds/', | 84 'scope': 'https://docs.google.com/feeds/', |
85 'app_name': 'My Google Docs Extension' | 85 'app_name': 'My Google Docs Extension' |
86 }); | 86 }); |
87 </pre> | 87 </pre> |
88 | 88 |
89 <p> | 89 <p> |
90 To use the OAuth library, | 90 To use the OAuth library, |
91 you must declare the "tabs" permision in the | 91 you must declare the "tabs" permision in the |
92 <a href="http://code.google.com/chrome/extensions/manifest.html">extension manif
est</a>. | 92 <a href="manifest.html">extension manifest</a>. |
93 You must also declare the sites you are using | 93 You must also declare the sites you are using |
94 including the request URL, the authorize URL, access URL, | 94 including the request URL, the authorize URL, access URL, |
95 and, if necessary, the scope URL. | 95 and, if necessary, the scope URL. |
96 For example: | 96 For example: |
97 </p> | 97 </p> |
98 | 98 |
99 <pre> | 99 <pre> |
100 "permissions": [ "tabs", "https://docs.google.com/feeds/*", | 100 "permissions": [ "tabs", "https://docs.google.com/feeds/*", |
101 "https://www.google.com/accounts/OAuthGetRequestToken", | 101 "https://www.google.com/accounts/OAuthGetRequestToken", |
102 "https://www.google.com/accounts/OAuthAuthorizeToken", | 102 "https://www.google.com/accounts/OAuthAuthorizeToken", |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 <h2 id="sample-code">Sample code</h2> | 206 <h2 id="sample-code">Sample code</h2> |
207 | 207 |
208 <p> | 208 <p> |
209 Sample extensions that use these techniques are available in the Chromium source
tree: | 209 Sample extensions that use these techniques are available in the Chromium source
tree: |
210 </p> | 210 </p> |
211 | 211 |
212 <ul> | 212 <ul> |
213 <li><a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/exten
sions/docs/examples/extensions/gdocs/">.../examples/extensions/gdocs/</a></li> | 213 <li><a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/exten
sions/docs/examples/extensions/gdocs/">.../examples/extensions/gdocs/</a></li> |
214 <li><a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/exten
sions/docs/examples/extensions/oauth_contacts/">.../examples/extensions/oauth_co
ntacts/</a></li> | 214 <li><a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/exten
sions/docs/examples/extensions/oauth_contacts/">.../examples/extensions/oauth_co
ntacts/</a></li> |
215 </ul> | 215 </ul> |
OLD | NEW |