| OLD | NEW |
| 1 A client library for authenticating with a remote service via OAuth2 on | 1 A client library for authenticating with a remote service via OAuth2 on |
| 2 behalf of a user, and making authorized HTTP requests with the user's OAuth2 | 2 behalf of a user, and making authorized HTTP requests with the user's OAuth2 |
| 3 credentials. Currently this only works where `dart:io` is available. | 3 credentials. |
| 4 | 4 |
| 5 OAuth2 allows a client (the program using this library) to access and | 5 OAuth2 allows a client (the program using this library) to access and |
| 6 manipulate a resource that's owned by a resource owner (the end user) and | 6 manipulate a resource that's owned by a resource owner (the end user) and |
| 7 lives on a remote server. The client directs the resource owner to an | 7 lives on a remote server. The client directs the resource owner to an |
| 8 authorization server (usually but not always the same as the server that | 8 authorization server (usually but not always the same as the server that |
| 9 hosts the resource), where the resource owner tells the authorization server | 9 hosts the resource), where the resource owner tells the authorization server |
| 10 to give the client an access token. This token serves as proof that the | 10 to give the client an access token. This token serves as proof that the |
| 11 client has permission to access resources on behalf of the resource owner. | 11 client has permission to access resources on behalf of the resource owner. |
| 12 | 12 |
| 13 OAuth2 provides several different methods for the client to obtain | 13 OAuth2 provides several different methods for the client to obtain |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // Once we're done with the client, save the credentials file. This | 91 // Once we're done with the client, save the credentials file. This |
| 92 // ensures that if the credentials were automatically refreshed | 92 // ensures that if the credentials were automatically refreshed |
| 93 // while using the client, the new credentials are available for the | 93 // while using the client, the new credentials are available for the |
| 94 // next run of the program. | 94 // next run of the program. |
| 95 return credentialsFile.open(FileMode.WRITE).then((file) { | 95 return credentialsFile.open(FileMode.WRITE).then((file) { |
| 96 return file.writeString(client.credentials.toJson()); | 96 return file.writeString(client.credentials.toJson()); |
| 97 }).then((file) => file.close()).then((_) => result); | 97 }).then((file) => file.close()).then((_) => result); |
| 98 }); | 98 }); |
| 99 }).then(print); | 99 }).then(print); |
| 100 ``` | 100 ``` |
| OLD | NEW |