File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Microsoft.AzureRepos.Tests Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ public class AzureDevOpsApiTests
18
18
{
19
19
private const string ExpectedLocationServicePath = "_apis/ServiceDefinitions/LocationService2/951917AC-A960-4999-8464-E3F0AA25B381?api-version=1.0" ;
20
20
private const string ExpectedIdentityServicePath = "_apis/token/sessiontokens?api-version=1.0&tokentype=compact" ;
21
+ private const string CommonAuthority = "https://login.microsoftonline.com/common" ;
21
22
22
23
[ Fact ]
23
24
public async Task AzureDevOpsRestApi_GetAuthorityAsync_NullUri_ThrowsException ( )
@@ -47,7 +48,7 @@ public async Task AzureDevOpsRestApi_GetAuthorityAsync_NoHeaders_ReturnsCommonAu
47
48
var context = new TestCommandContext ( ) ;
48
49
var uri = new Uri ( "https://example.com" ) ;
49
50
50
- const string expectedAuthority = "https://login.microsoftonline.com/common" ;
51
+ const string expectedAuthority = CommonAuthority ;
51
52
52
53
var httpResponse = new HttpResponseMessage ( HttpStatusCode . Unauthorized ) ;
53
54
@@ -166,13 +167,13 @@ public async Task AzureDevOpsRestApi_GetAuthorityAsync_VssResourceTenantMultiple
166
167
}
167
168
168
169
[ Fact ]
169
- public async Task AzureDevOpsRestApi_GetAuthorityAsync_VssResourceTenantMsa_ReturnsMsaAuthority ( )
170
+ public async Task AzureDevOpsRestApi_GetAuthorityAsync_VssResourceTenantMsa_ReturnsCommonAuthority ( )
170
171
{
171
172
var context = new TestCommandContext ( ) ;
172
173
var uri = new Uri ( "https://example.com" ) ;
173
174
var msaTenantId = Guid . Empty ;
174
175
175
- const string expectedAuthority = "https://login.microsoftonline.com/live.com" ;
176
+ const string expectedAuthority = CommonAuthority ;
176
177
177
178
var httpResponse = new HttpResponseMessage ( HttpStatusCode . Unauthorized )
178
179
{
Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ public async Task<string> GetAuthorityAsync(Uri organizationUri)
41
41
42
42
const string authorityBase = "https://login.microsoftonline.com/" ;
43
43
const string commonAuthority = authorityBase + "common" ;
44
- const string msaAuthority = authorityBase + "live.com" ;
45
44
46
45
_context . Trace . WriteLine ( $ "HTTP: HEAD { organizationUri } ") ;
47
46
using ( HttpResponseMessage response = await HttpClient . HeadAsync ( organizationUri ) )
@@ -80,7 +79,7 @@ public async Task<string> GetAuthorityAsync(Uri organizationUri)
80
79
if ( tenantIds . Length == 1 && Guid . TryParse ( tenantIds [ 0 ] , out guid ) && guid == Guid . Empty )
81
80
{
82
81
_context . Trace . WriteLine ( $ "Found { AzureDevOpsConstants . VssResourceTenantHeader } header with MSA tenant ID (empty GUID).") ;
83
- return msaAuthority ;
82
+ return commonAuthority ;
84
83
}
85
84
}
86
85
}
You can’t perform that action at this time.
0 commit comments