Google.PowerShell.Common.AuthenticateWithSdkCredentialsExecutor.RevokeTokenAsync C# (CSharp) 메소드

RevokeTokenAsync() 공개 메소드

Asynchronously revokes the token by calling Google.Apis.Auth.OAuth2.Flows.IAuthorizationCodeFlow.RevokeTokenAsync.
public RevokeTokenAsync ( CancellationToken taskCancellationToken ) : Task
taskCancellationToken System.Threading.CancellationToken Cancellation token to cancel an operation.
리턴 Task
        public async Task<bool> RevokeTokenAsync(CancellationToken taskCancellationToken)
        {
            TokenResponse userToken = await ActiveUserConfig.GetActiveUserToken(taskCancellationToken);

            await flow.RevokeTokenAsync("userId", userToken.AccessToken, taskCancellationToken).ConfigureAwait(false);
            // We don't set the token to null, cause we want that the next request (without reauthorizing) will fail).
            return true;
        }
    }