| OLD | NEW |
| 1 <h1>User Authentication</h1> | 1 <h1>User Authentication</h1> |
| 2 | 2 |
| 3 <p> | 3 <p> |
| 4 Web authentication protocols utilize HTTP features, | 4 Web authentication protocols utilize HTTP features, |
| 5 but Chrome Apps run inside the app container; | 5 but Chrome Apps run inside the app container; |
| 6 they don’t load over HTTP and can’t perform redirects or set cookies. | 6 they don’t load over HTTP and can’t perform redirects or set cookies. |
| 7 </p> | 7 </p> |
| 8 | 8 |
| 9 <p> | 9 <p> |
| 10 Use the <a href="identity.html">Chrome Identity API</a> | 10 Use the <a href="identity">Chrome Identity API</a> |
| 11 to authenticate users: | 11 to authenticate users: |
| 12 the <code>getAuthToken</code> for users logged into their Google Account and | 12 the <code>getAuthToken</code> for users logged into their Google Account and |
| 13 the <code>launchWebAuthFlow</code> for users logged into a non-Google account. | 13 the <code>launchWebAuthFlow</code> for users logged into a non-Google account. |
| 14 If your app uses its own server to authenticate users, you will need to use the
latter. | 14 If your app uses its own server to authenticate users, you will need to use the
latter. |
| 15 </p> | 15 </p> |
| 16 | 16 |
| 17 <p class="note"> | 17 <p class="note"> |
| 18 <b>API Samples: </b> | 18 <b>API Samples: </b> |
| 19 Want to play with the code? | 19 Want to play with the code? |
| 20 Check out | 20 Check out |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 <li>Get an OAuth2 client ID for your Chrome App.</li> | 53 <li>Get an OAuth2 client ID for your Chrome App.</li> |
| 54 <li>Update your manifest to include the client ID and scopes.</li> | 54 <li>Update your manifest to include the client ID and scopes.</li> |
| 55 <li>Get the authentication token.</li> | 55 <li>Get the authentication token.</li> |
| 56 </ol> | 56 </ol> |
| 57 | 57 |
| 58 <h3 id="add_permissions">Add permissions and upload app</h3> | 58 <h3 id="add_permissions">Add permissions and upload app</h3> |
| 59 | 59 |
| 60 <p> | 60 <p> |
| 61 You need to make sure the identity permission is in your manifest. | 61 You need to make sure the identity permission is in your manifest. |
| 62 You can then upload your app to the apps and extensions management | 62 You can then upload your app to the apps and extensions management |
| 63 page (see <a href="publish_app.html">Publish</a>). | 63 page (see <a href="publish_app">Publish</a>). |
| 64 </p> | 64 </p> |
| 65 | 65 |
| 66 <pre data-filename="manifest.json"> | 66 <pre data-filename="manifest.json"> |
| 67 "permissions": [ | 67 "permissions": [ |
| 68 "identity" | 68 "identity" |
| 69 ] | 69 ] |
| 70 </pre> | 70 </pre> |
| 71 | 71 |
| 72 <h3 id="copy_key">Copy key to your manifest</h3> | 72 <h3 id="copy_key">Copy key to your manifest</h3> |
| 73 | 73 |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 </p> | 348 </p> |
| 349 | 349 |
| 350 <p> | 350 <p> |
| 351 The best practice we suggest is to use silent mode | 351 The best practice we suggest is to use silent mode |
| 352 when there is no user gesture involved and use interactive mode | 352 when there is no user gesture involved and use interactive mode |
| 353 if there is a user gesture (for example, the user clicked the Sign In button in
your app). | 353 if there is a user gesture (for example, the user clicked the Sign In button in
your app). |
| 354 Note that we do not enforce gesture requirement. | 354 Note that we do not enforce gesture requirement. |
| 355 </p> | 355 </p> |
| 356 | 356 |
| 357 <p class="backtotop"><a href="#top">Back to top</a></p> | 357 <p class="backtotop"><a href="#top">Back to top</a></p> |
| OLD | NEW |