Skip to content

Commit 0e18eb8

Browse files
committed
Remove unused constant
1 parent 355330b commit 0e18eb8

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

tests/Microsoft.Identity.Test.LabInfrastructure/LabAuthenticationHelper.cs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,21 @@ namespace Microsoft.Identity.Test.LabInfrastructure
1616
{
1717
internal static class LabAuthenticationHelper
1818
{
19-
public static async Task<AccessToken> GetAccessTokenForLabAPIAsync(string labAccessClientId)
19+
public static async Task<AccessToken> GetAccessTokenForLabAPIAsync()
2020
{
2121
string[] scopes = [LabApiConstants.LabScope];
2222

2323
return await GetLabAccessTokenAsync(
2424
LabApiConstants.LabClientInstance + LabApiConstants.LabClientTenantId,
25-
scopes,
26-
labAccessClientId).ConfigureAwait(false);
25+
scopes).ConfigureAwait(false);
2726
}
2827

2928
public static async Task<AccessToken> GetLabAccessTokenAsync(string authority, string[] scopes)
30-
{
31-
return await GetLabAccessTokenAsync(
32-
authority,
33-
scopes,
34-
String.Empty).ConfigureAwait(false);
35-
}
36-
37-
public static async Task<AccessToken> GetLabAccessTokenAsync(string authority, string[] scopes, string clientId)
3829
{
3930
AuthenticationResult authResult;
4031
IConfidentialClientApplication confidentialApp;
4132
X509Certificate2 cert;
4233

43-
var clientIdForCertAuth = String.IsNullOrEmpty(clientId) ?
44-
LabApiConstants.LabClientId : clientId;
45-
4634
cert = CertificateHelper.FindCertificateByName(TestConstants.AutomationTestCertName);
4735
if (cert == null)
4836
{
@@ -51,7 +39,7 @@ public static async Task<AccessToken> GetLabAccessTokenAsync(string authority, s
5139
}
5240

5341
confidentialApp = ConfidentialClientApplicationBuilder
54-
.Create(clientIdForCertAuth)
42+
.Create(LabApiConstants.LabClientId)
5543
.WithAuthority(new Uri(authority), true)
5644
.WithCacheOptions(CacheOptions.EnableSharedCacheOptions)
5745
.WithCertificate(cert, true)

tests/Microsoft.Identity.Test.LabInfrastructure/LabServiceApi.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,19 @@ namespace Microsoft.Identity.Test.LabInfrastructure
1717
/// </summary>
1818
public class LabServiceApi
1919
{
20-
private string _labAccessAppId;
2120
private AccessToken? _labApiAccessToken;
2221
private AccessToken? _msiHelperApiAccessToken;
2322

2423
public LabServiceApi()
2524
{
26-
KeyVaultSecretsProvider _keyVaultSecretsProvider = new KeyVaultSecretsProvider();
27-
_labAccessAppId = _keyVaultSecretsProvider.GetSecretByName("LabVaultAppID").Value;
2825
}
2926

3027
public async Task<string> GetMSIHelperServiceTokenAsync()
3128
{
3229
if (_msiHelperApiAccessToken == null)
3330
{
3431
_msiHelperApiAccessToken = await LabAuthenticationHelper
35-
.GetAccessTokenForLabAPIAsync(_labAccessAppId)
32+
.GetAccessTokenForLabAPIAsync()
3633
.ConfigureAwait(false);
3734
}
3835

@@ -172,7 +169,7 @@ private async Task<string> SendLabRequestAsync(string requestUrl, Dictionary<str
172169
internal async Task<string> GetLabResponseAsync(string address)
173170
{
174171
if (_labApiAccessToken == null)
175-
_labApiAccessToken = await LabAuthenticationHelper.GetAccessTokenForLabAPIAsync(_labAccessAppId).ConfigureAwait(false);
172+
_labApiAccessToken = await LabAuthenticationHelper.GetAccessTokenForLabAPIAsync().ConfigureAwait(false);
176173

177174
using (HttpClient httpClient = new HttpClient())
178175
{

0 commit comments

Comments
 (0)