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

InterceptAsync() 공개 메소드

Default implementation is to try to refresh the access token if there is no access token or if we are 1 minute away from expiration. If token server is unavailable, it will try to use the access token even if has expired. If successful, it will call IAccessMethod.Intercept.
public InterceptAsync ( HttpRequestMessage request, CancellationToken taskCancellationToken ) : Task
request System.Net.Http.HttpRequestMessage
taskCancellationToken System.Threading.CancellationToken
리턴 Task
        public async Task InterceptAsync(HttpRequestMessage request, CancellationToken taskCancellationToken)
        {
            Task<string> getAccessTokenTask = GetAccessTokenForRequestAsync(request.RequestUri.ToString(), taskCancellationToken);
            string accessToken = await getAccessTokenTask.ConfigureAwait(false);
            flow.AccessMethod.Intercept(request, accessToken);
        }