OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library oauth2; | 5 library oauth2; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 import 'dart:uri'; | 9 import 'dart:uri'; |
10 | 10 |
11 // TODO(nweiz): Make this a "package:" URL, or something nicer than this. | 11 import 'package:oauth2/oauth2.dart'; |
12 import '../../pkg/oauth2/lib/oauth2.dart'; | 12 import 'package:pathos/path.dart' as path; |
13 import '../../pkg/pathos/lib/path.dart' as path; | |
14 | 13 |
15 import 'http.dart'; | 14 import 'http.dart'; |
16 import 'io.dart'; | 15 import 'io.dart'; |
17 import 'log.dart' as log; | 16 import 'log.dart' as log; |
18 import 'safe_http_server.dart'; | 17 import 'safe_http_server.dart'; |
19 import 'system_cache.dart'; | 18 import 'system_cache.dart'; |
20 import 'utils.dart'; | 19 import 'utils.dart'; |
21 | 20 |
22 export '../../pkg/oauth2/lib/oauth2.dart'; | 21 export 'package:oauth2/oauth2.dart'; |
23 | 22 |
24 /// The pub client's OAuth2 identifier. | 23 /// The pub client's OAuth2 identifier. |
25 final _identifier = '818368855108-8grd2eg9tj9f38os6f1urbcvsq399u8n.apps.' | 24 final _identifier = '818368855108-8grd2eg9tj9f38os6f1urbcvsq399u8n.apps.' |
26 'googleusercontent.com'; | 25 'googleusercontent.com'; |
27 | 26 |
28 /// The pub client's OAuth2 secret. This isn't actually meant to be kept a | 27 /// The pub client's OAuth2 secret. This isn't actually meant to be kept a |
29 /// secret. | 28 /// secret. |
30 final _secret = 'SWeqj8seoJW0w7_CpEPFLX0K'; | 29 final _secret = 'SWeqj8seoJW0w7_CpEPFLX0K'; |
31 | 30 |
32 /// The URL to which the user will be directed to authorize the pub client to | 31 /// The URL to which the user will be directed to authorize the pub client to |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 response.statusCode = 404; | 197 response.statusCode = 404; |
199 response.close(); | 198 response.close(); |
200 } | 199 } |
201 }); | 200 }); |
202 }) | 201 }) |
203 .then((client) { | 202 .then((client) { |
204 log.message('Successfully authorized.\n'); | 203 log.message('Successfully authorized.\n'); |
205 return client; | 204 return client; |
206 }); | 205 }); |
207 } | 206 } |
OLD | NEW |