Skip to content

Commit

Permalink
Speed up azure service token provider (Azure#7527)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidParks8 authored and pakrym committed Sep 12, 2019
1 parent a2f2ef3 commit 884edf1
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ private List<NonInteractiveAzureServiceTokenProviderBase> GetTokenProviders()
return authResult.AccessToken;
}

public async Task<string> GetAccessTokenAsync(string resource, string tenantId)
public Task<string> GetAccessTokenAsync(string resource, string tenantId)
{
return await GetAccessTokenAsync(resource, tenantId, default(CancellationToken)).ConfigureAwait(false);
return GetAccessTokenAsync(resource, tenantId, default(CancellationToken));
}

/// <summary>
Expand All @@ -267,7 +267,7 @@ public async Task<string> GetAccessTokenAsync(string resource, string tenantId)
/// <returns>Access token</returns>
/// <exception cref="ArgumentNullException">Thrown if resource is null or empty.</exception>
/// <exception cref="AzureServiceTokenProviderException">Thrown if access token cannot be acquired.</exception>
public async Task<AppAuthenticationResult> GetAuthenticationResultAsync(string resource, string tenantId = default(string),
public Task<AppAuthenticationResult> GetAuthenticationResultAsync(string resource, string tenantId = default(string),
CancellationToken cancellationToken = default(CancellationToken))
{
if (string.IsNullOrWhiteSpace(resource))
Expand All @@ -277,12 +277,12 @@ public async Task<string> GetAccessTokenAsync(string resource, string tenantId)

string authority = string.IsNullOrEmpty(tenantId) ? string.Empty : $"{_azureAdInstance}{tenantId}";

return await GetAuthResultAsyncImpl(resource, authority, cancellationToken).ConfigureAwait(false);
return GetAuthResultAsyncImpl(resource, authority, cancellationToken);
}

public async Task<AppAuthenticationResult> GetAuthenticationResultAsync(string resource, string tenantId)
public Task<AppAuthenticationResult> GetAuthenticationResultAsync(string resource, string tenantId)
{
return await GetAuthenticationResultAsync(resource, tenantId, default(CancellationToken)).ConfigureAwait(false);
return GetAuthenticationResultAsync(resource, tenantId, default(CancellationToken));
}
}
}

0 comments on commit 884edf1

Please sign in to comment.