Skip to content

Commit e2c846f

Browse files
committed
New test fix
1 parent a6534ce commit e2c846f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/SqlClientCustomTokenCredential.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,16 @@ private async Task<AccessToken> AcquireTokenAsync()
5757
{
5858
_authority = value;
5959
}
60-
}
60+
else if (key.Equals("resource", StringComparison.InvariantCultureIgnoreCase))
61+
{
62+
_resource = value;
63+
}
6164
}
6265
}
6366
}
6467
}
6568
// Since this is a test, we only create single-instance temp cache
66-
_akvUrl = _resource = DataTestUtility.AKVUrl;
69+
_akvUrl = DataTestUtility.AKVUrl;
6770
}
6871

6972
AccessToken accessToken = await AzureActiveDirectoryAuthenticationCallback(_authority, _resource);
@@ -95,7 +98,7 @@ public static async Task<AccessToken> AzureActiveDirectoryAuthenticationCallback
9598
{
9699
using CancellationTokenSource cts = new();
97100
cts.CancelAfter(30000); // Hard coded for tests
98-
string[] scopes = new string[] { resource };
101+
string[] scopes = new string[] { resource + "/.default" };
99102
TokenRequestContext tokenRequestContext = new(scopes);
100103
int seperatorIndex = authority.LastIndexOf('/');
101104
string authorityHost = authority.Remove(seperatorIndex + 1);

0 commit comments

Comments
 (0)