Index: Src/GoogleApis.Auth.WinRT/OAuth2/GoogleWebAuthorizationBroker.cs =================================================================== --- a/Src/GoogleApis.Auth.WinRT/OAuth2/GoogleWebAuthorizationBroker.cs +++ b/Src/GoogleApis.Auth.WinRT/OAuth2/GoogleWebAuthorizationBroker.cs @@ -69,10 +69,27 @@ DataStore = new StroageDataStore() }; - var installedApp = new AuthorizationCodeWinRTInstalledApp(initializer); + var installedApp = new AuthorizationCodeWinRTInstalledApp(new GoogleAuthorizationCodeFlow(initializer)); return await installedApp.AuthorizeAsync(user, taskCancellationToken).ConfigureAwait(false); } + /// + /// Reauthorizes asynchronously the user. This method should be called if the user wants to reauthorize after + /// he already revoked the token. + /// + /// The current user credential. Its + /// will be updated. + /// Cancellation token to cancel an operation. + public static async Task ReauthorizeAsync(UserCredential userCredential, + CancellationToken taskCancellationToken) + { + var installedApp = new AuthorizationCodeWinRTInstalledApp(userCredential.Flow); + // Create an authorization code installed app instance and authorize the user. + UserCredential newUserCredential = await installedApp.AuthorizeAsync( + userCredential.UderId, taskCancellationToken).ConfigureAwait(false); + userCredential.Token = newUserCredential.Token; + } + /// Loads the client secrets from the given URI. /// The client secrets URI. /// Client secrets.