LEFT | RIGHT |
1 /* | 1 /* |
2 Copyright 2013 Google Inc | 2 Copyright 2013 Google Inc |
3 | 3 |
4 Licensed under the Apache License, Version 2.0 (the "License"); | 4 Licensed under the Apache License, Version 2.0 (the "License"); |
5 you may not use this file except in compliance with the License. | 5 you may not use this file except in compliance with the License. |
6 You may obtain a copy of the License at | 6 You may obtain a copy of the License at |
7 | 7 |
8 http://www.apache.org/licenses/LICENSE-2.0 | 8 http://www.apache.org/licenses/LICENSE-2.0 |
9 | 9 |
10 Unless required by applicable law or agreed to in writing, software | 10 Unless required by applicable law or agreed to in writing, software |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 { | 259 { |
260 token.RefreshToken = refreshToken; | 260 token.RefreshToken = refreshToken; |
261 } | 261 } |
262 | 262 |
263 await StoreTokenAsync(userId, token, taskCancellationToken).Configur
eAwait(false); | 263 await StoreTokenAsync(userId, token, taskCancellationToken).Configur
eAwait(false); |
264 return token; | 264 return token; |
265 } | 265 } |
266 | 266 |
267 public virtual Task RevokeTokenAsync(string userId, string token, Cancel
lationToken taskCancellationToken) | 267 public virtual Task RevokeTokenAsync(string userId, string token, Cancel
lationToken taskCancellationToken) |
268 { | 268 { |
269 throw new NotImplementedException("The pure OAuth 2.0 protocol doesn
't support revoking a token"); | 269 throw new NotImplementedException("The OAuth 2.0 protocol does not s
upport token revocation."); |
270 } | 270 } |
271 | 271 |
272 #endregion | 272 #endregion |
273 | 273 |
274 /// <summary>Stores the token in the <see cref="DataStore"/>.</summary> | 274 /// <summary>Stores the token in the <see cref="DataStore"/>.</summary> |
275 /// <param name="userId">User identifier.</param> | 275 /// <param name="userId">User identifier.</param> |
276 /// <param name="token">Token to store.</param> | 276 /// <param name="token">Token to store.</param> |
277 /// <param name="taskCancellationToken">Cancellation token to cancel ope
ration.</param> | 277 /// <param name="taskCancellationToken">Cancellation token to cancel ope
ration.</param> |
278 private async Task StoreTokenAsync(string userId, TokenResponse token, C
ancellationToken taskCancellationToken) | 278 private async Task StoreTokenAsync(string userId, TokenResponse token, C
ancellationToken taskCancellationToken) |
279 { | 279 { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 316 |
317 public void Dispose() | 317 public void Dispose() |
318 { | 318 { |
319 if (HttpClient != null) | 319 if (HttpClient != null) |
320 { | 320 { |
321 HttpClient.Dispose(); | 321 HttpClient.Dispose(); |
322 } | 322 } |
323 } | 323 } |
324 } | 324 } |
325 } | 325 } |
LEFT | RIGHT |