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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } | 58 } |
59 } | 59 } |
60 | 60 |
61 /// <summary>Gets the authorization code flow.</summary> | 61 /// <summary>Gets the authorization code flow.</summary> |
62 public IAuthorizationCodeFlow Flow | 62 public IAuthorizationCodeFlow Flow |
63 { | 63 { |
64 get { return flow; } | 64 get { return flow; } |
65 } | 65 } |
66 | 66 |
67 /// <summary>Gets the user identity.</summary> | 67 /// <summary>Gets the user identity.</summary> |
68 public string UderId | 68 public string UserId |
69 { | 69 { |
70 get { return userId; } | 70 get { return userId; } |
71 } | 71 } |
72 | 72 |
73 private readonly IAuthorizationCodeFlow flow; | 73 private readonly IAuthorizationCodeFlow flow; |
74 private readonly string userId; | 74 private readonly string userId; |
75 | 75 |
76 /// <summary>Constructs a new credential instance.</summary> | 76 /// <summary>Constructs a new credential instance.</summary> |
77 /// <param name="flow">Authorization code flow.</param> | 77 /// <param name="flow">Authorization code flow.</param> |
78 /// <param name="userId">User identifier.</param> | 78 /// <param name="userId">User identifier.</param> |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 return false; | 178 return false; |
179 } | 179 } |
180 | 180 |
181 await flow.RevokeTokenAsync(userId, Token.AccessToken, taskCancellat
ionToken).ConfigureAwait(false); | 181 await flow.RevokeTokenAsync(userId, Token.AccessToken, taskCancellat
ionToken).ConfigureAwait(false); |
182 Logger.Info("Access token was revoked successfully"); | 182 Logger.Info("Access token was revoked successfully"); |
183 // We don't set the token to null, cause we want that the next reque
st (without reauthorizing) will fail). | 183 // We don't set the token to null, cause we want that the next reque
st (without reauthorizing) will fail). |
184 return true; | 184 return true; |
185 } | 185 } |
186 } | 186 } |
187 } | 187 } |
OLD | NEW |