OLD | NEW |
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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 // The new token may not contain a refresh token, so set it with the
given refresh token. | 257 // The new token may not contain a refresh token, so set it with the
given refresh token. |
258 if (token.RefreshToken == null) | 258 if (token.RefreshToken == null) |
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) |
| 268 { |
| 269 throw new NotImplementedException("The OAuth 2.0 protocol does not s
upport token revocation."); |
| 270 } |
| 271 |
267 #endregion | 272 #endregion |
268 | 273 |
269 /// <summary>Stores the token in the <see cref="DataStore"/>.</summary> | 274 /// <summary>Stores the token in the <see cref="DataStore"/>.</summary> |
270 /// <param name="userId">User identifier.</param> | 275 /// <param name="userId">User identifier.</param> |
271 /// <param name="token">Token to store.</param> | 276 /// <param name="token">Token to store.</param> |
272 /// <param name="taskCancellationToken">Cancellation token to cancel ope
ration.</param> | 277 /// <param name="taskCancellationToken">Cancellation token to cancel ope
ration.</param> |
273 private async Task StoreTokenAsync(string userId, TokenResponse token, C
ancellationToken taskCancellationToken) | 278 private async Task StoreTokenAsync(string userId, TokenResponse token, C
ancellationToken taskCancellationToken) |
274 { | 279 { |
275 taskCancellationToken.ThrowIfCancellationRequested(); | 280 taskCancellationToken.ThrowIfCancellationRequested(); |
276 if (DataStore != null) | 281 if (DataStore != null) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 | 316 |
312 public void Dispose() | 317 public void Dispose() |
313 { | 318 { |
314 if (HttpClient != null) | 319 if (HttpClient != null) |
315 { | 320 { |
316 HttpClient.Dispose(); | 321 HttpClient.Dispose(); |
317 } | 322 } |
318 } | 323 } |
319 } | 324 } |
320 } | 325 } |
OLD | NEW |