OLD | NEW |
1 <h1>Identify User</h1> | 1 <h1>Identify User</h1> |
2 | 2 |
3 | 3 |
4 <p> | 4 <p> |
5 Web authentication protocols utilize HTTP features, | 5 Web authentication protocols utilize HTTP features, |
6 but packaged apps run inside the app container; | 6 but packaged apps run inside the app container; |
7 they don’t load over HTTP and can’t perform redirects or set cookies. | 7 they don’t load over HTTP and can’t perform redirects or set cookies. |
8 </p> | 8 </p> |
9 | 9 |
10 <p> | 10 <p> |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 <p> | 80 <p> |
81 You need to copy the key in the installed | 81 You need to copy the key in the installed |
82 <code>manifest.json</code> to your source manifest. | 82 <code>manifest.json</code> to your source manifest. |
83 This ensures that the key isn't overridden anytime your reload your app | 83 This ensures that the key isn't overridden anytime your reload your app |
84 or share the app with other users. | 84 or share the app with other users. |
85 It's not the most graceful task, but here's how it goes: | 85 It's not the most graceful task, but here's how it goes: |
86 </p> | 86 </p> |
87 | 87 |
88 <ol> | 88 <ol> |
89 » <li>Go to your | 89 <li>Go to your <a href="http://www.chromium.org/user-experience/user-data-dire
ctory">user data |
90 » » <a href="http://www.chromium.org/user-experience/user-data-direc
tory">user data directory</a>. | 90 directory</a>. Example on MacOs: |
91 » » Example on MacOs: <code>~/Library/Application\ Support/Google/Ch
rome/Default/Extensions</code></li> | 91 <code>~/Library/Application\ Support/Google/Chrome/Default/Extensions</code></
li> |
92 » <li>List the installed apps and extensions and match your app ID on the
apps and extensions management page | 92 <li>List the installed apps and extensions and match your app ID on the apps a
nd extensions |
93 » » to the same ID here.</li> | 93 management page to the same ID here.</li> |
94 » <li>Go to the installed app directory (this will be a version within the
app ID). | 94 <li>Go to the installed app directory (this will be a version within the app I
D). |
95 » » Open the installed <code>manifest.json</code> | 95 Open the installed <code>manifest.json</code> (pico is a quick way to open the
file).</li> |
96 » » (pico is a quick way to open the file).</li> | 96 <li>Copy the "key" in the installed <code>manifest.json</code> and paste it in
to your app's |
97 » <li>Copy the "key" in the installed <code>manifest.json</code> and paste
it into your app's source manifest file.</li> | 97 source manifest file.</li> |
98 </ol> | 98 </ol> |
99 | 99 |
100 <h3 id="client_id">Get your client ID</h3> | 100 <h3 id="client_id">Get your client ID</h3> |
101 | 101 |
102 <p> | 102 <p> |
103 Setting up the client ID is currently not available externally | 103 You need to register your app |
104 via <a href="https://devconsole-canary.corp.google.com/apis/">Google APIs Consol
e</a>. | 104 in the Google APIs Console |
105 So to setup the OAuth2 client ID, | 105 to get the client ID: |
106 email <a href="mailto:chrome-apps-auth-requests@google.com">chrome-apps-auth-req
uest@google.com</a> | 106 </p> |
107 with your stable app ID and | 107 |
108 we will reply appropriately with your OAuth2 client ID. | 108 <ol> |
| 109 <li>Login to the <a href="https://code.google.com/apis/console/">Google APIs C
onsole</a> |
| 110 using the same Google account used to upload your app to the Chrome Web Store.
</li> |
| 111 <li>Create a new project by expanding the drop-down menu in the top-left |
| 112 corner and selecting the <strong>Create...</strong> menu item. </li> |
| 113 <li> Once created and named, go to the "Services" navigation menu item and |
| 114 turn on any Google services your app needs. </li> |
| 115 <li> Go to the "API Access" navigation menu item and click on the |
| 116 <strong>Create an OAuth 2.0 client ID...</strong> blue button. </li> |
| 117 <li> Enter the requested branding information, |
| 118 select the <strong>Installed application</strong> type. </li> |
| 119 <li> Select <strong>Chrome Application</strong> and enter your application ID |
| 120 (same ID displayed in the apps and extensions management page). </li> |
| 121 </ol> |
| 122 |
| 123 <p class="warning"> |
| 124 <strong>Warning: </strong> |
| 125 If the app ID here does not match your app ID, |
| 126 an error will occur when your app calls <a href="#token">getAuthToken()</a>. |
109 </p> | 127 </p> |
110 | 128 |
111 <h3 id="update_manifest">Update your manifest</h3> | 129 <h3 id="update_manifest">Update your manifest</h3> |
112 | 130 |
113 <p> | 131 <p> |
114 You need to update your manifest to include | 132 You need to update your manifest to include |
115 the client ID and scopes. | 133 the client ID and scopes. |
116 Here's the sample "oauth2" for the | 134 Here's the sample "oauth2" for the |
117 <a href="https://github.com/GoogleChrome/chrome-app-samples/tree/master/gdocs">g
docs sample</a>: | 135 <a href="https://github.com/GoogleChrome/chrome-app-samples/tree/master/gdocs">g
docs sample</a>: |
118 </p> | 136 </p> |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 </p> | 258 </p> |
241 | 259 |
242 <p> | 260 <p> |
243 The best practice we suggest is to use silent mode | 261 The best practice we suggest is to use silent mode |
244 when there is no user gesture involved and use interactive mode | 262 when there is no user gesture involved and use interactive mode |
245 if there is a user gesture (for example, the user clicked the Sign In button in
your app). | 263 if there is a user gesture (for example, the user clicked the Sign In button in
your app). |
246 Note that we do not enforce gesture requirement. | 264 Note that we do not enforce gesture requirement. |
247 </p> | 265 </p> |
248 | 266 |
249 <p class="backtotop"><a href="#top">Back to top</a></p> | 267 <p class="backtotop"><a href="#top">Back to top</a></p> |
OLD | NEW |