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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 { | 76 { |
77 var initializer = new GoogleAuthorizationCodeFlow.Initializer | 77 var initializer = new GoogleAuthorizationCodeFlow.Initializer |
78 { | 78 { |
79 ClientSecretsStream = clientSecretsStream, | 79 ClientSecretsStream = clientSecretsStream, |
80 }; | 80 }; |
81 return await AuthorizeAsyncCore(initializer, scopes, user, taskCance
llationToken, dataStore) | 81 return await AuthorizeAsyncCore(initializer, scopes, user, taskCance
llationToken, dataStore) |
82 .ConfigureAwait(false); | 82 .ConfigureAwait(false); |
83 } | 83 } |
84 | 84 |
85 /// <summary> | 85 /// <summary> |
86 /// Asynchronously reauthorizes the user. This method should be called i
f the user wants to authorize after· | 86 /// Asynchronously reauthorizes the user. This method should be called i
f the users want to authorize after· |
87 /// they revoked the token. | 87 /// they revoked the token. |
88 /// </summary> | 88 /// </summary> |
89 /// <param name="userCredential">The current user credential. Its <see c
ref="UserCredential.Token"/> will be | 89 /// <param name="userCredential">The current user credential. Its <see c
ref="UserCredential.Token"/> will be |
90 /// updated. </param> | 90 /// updated. </param> |
91 /// <param name="taskCancellationToken">Cancellation token to cancel an
operation.</param> | 91 /// <param name="taskCancellationToken">Cancellation token to cancel an
operation.</param> |
92 public static async Task ReauthorizeAsync(UserCredential userCredential, | 92 public static async Task ReauthorizeAsync(UserCredential userCredential, |
93 CancellationToken taskCancellationToken) | 93 CancellationToken taskCancellationToken) |
94 { | 94 { |
95 // Create an authorization code installed app instance and authorize
the user. | 95 // Create an authorization code installed app instance and authorize
the user. |
96 UserCredential newUserCredential = await new AuthorizationCodeInstal
ledApp(userCredential.Flow, | 96 UserCredential newUserCredential = await new AuthorizationCodeInstal
ledApp(userCredential.Flow, |
(...skipping 18 matching lines...) Expand all Loading... |
115 initializer.Scopes = scopes; | 115 initializer.Scopes = scopes; |
116 initializer.DataStore = dataStore ?? new FileDataStore(Folder); | 116 initializer.DataStore = dataStore ?? new FileDataStore(Folder); |
117 var flow = new GoogleAuthorizationCodeFlow(initializer); | 117 var flow = new GoogleAuthorizationCodeFlow(initializer); |
118 | 118 |
119 // Create an authorization code installed app instance and authorize
the user. | 119 // Create an authorization code installed app instance and authorize
the user. |
120 return await new AuthorizationCodeInstalledApp(flow, new LocalServer
CodeReceiver()).AuthorizeAsync | 120 return await new AuthorizationCodeInstalledApp(flow, new LocalServer
CodeReceiver()).AuthorizeAsync |
121 (user, taskCancellationToken).ConfigureAwait(false); | 121 (user, taskCancellationToken).ConfigureAwait(false); |
122 } | 122 } |
123 } | 123 } |
124 } | 124 } |
LEFT | RIGHT |