262 references to Location
Aspire.Dashboard.Tests (7)
Integration\FrontendOpenIdConnectAuthTests.cs (1)
45var redirectedTo = response.Headers.Location;
Middleware\ValidateTokenMiddlewareTests.cs (6)
23Assert.Equal("/", response.Headers.Location?.OriginalString); 31Assert.Equal("/test", response.Headers.Location?.OriginalString); 39Assert.Equal("/login", response.Headers.Location?.OriginalString); 47Assert.Equal("/login?returnUrl=%2ftest", response.Headers.Location?.OriginalString); 55Assert.Equal("/", response.Headers.Location?.OriginalString); 63Assert.Equal("/test", response.Headers.Location?.OriginalString);
AuthSamples.FunctionalTests (4)
ClaimsTransformTests.cs (1)
41Assert.Equal("http://localhost/account/login?ReturnUrl=%2FHome%2FMyClaims", response.Headers.Location.ToString());
IdentityExternalClaimsTests.cs (1)
41Assert.Equal("http://localhost/Account/Login?ReturnUrl=%2FMyClaims", response.Headers.Location.ToString());
StaticFilesAuthTests.cs (1)
39Assert.Equal("http://localhost/Account/Login?ReturnUrl=%2F" + scenario, response.Headers.Location.ToString());
TestAssert.cs (1)
70return responseMessage.Headers.Location;
Microsoft.AspNetCore.Authentication.Test (151)
CookieTests.cs (12)
101var location = transaction.Response.Headers.Location; 1179var location = transaction.Response.Headers.Location; 1193var location = transaction.Response.Headers.Location; 1254var location = transaction.Response.Headers.Location; 1391var location = transaction.Response.Headers.Location; 1439var location = transaction.Response.Headers.Location; 1463var location = transaction.Response.Headers.Location; 1488var location = transaction.Response.Headers.Location; 1516Assert.Equal(redirectUrl, transaction.Response.Headers.Location.ToString()); 1561Assert.Equal("/ret_path_2", transaction.Response.Headers.Location.ToString()); 1607Assert.Equal("/redirect_test", transaction.Response.Headers.Location.ToString()); 1630var location = transaction.Response.Headers.Location;
FacebookTests.cs (8)
111var query = transaction.Response.Headers.Location.Query; 142Assert.Contains("scope=foo,bar", res.Headers.Location.Query); 174Assert.Contains("scope=baz,qux", res.Headers.Location.Query); 206Assert.Contains("scope=baz,qux", res.Headers.Location.Query); 232var location = transaction.Response.Headers.Location.AbsoluteUri; 265var location = transaction.Response.Headers.Location.AbsoluteUri; 300var location = transaction.Response.Headers.Location.AbsoluteUri; 435var locationUri = transaction.Response.Headers.Location;
GoogleTests.cs (8)
56var location = transaction.Response.Headers.Location; 152var query = transaction.Response.Headers.Location.Query; 190var query = QueryHelpers.ParseQuery(transaction.Response.Headers.Location.Query); 242var query = QueryHelpers.ParseQuery(transaction.Response.Headers.Location.Query); 298var query = QueryHelpers.ParseQuery(transaction.Response.Headers.Location.Query); 335var query = transaction.Response.Headers.Location.Query; 1016Assert.StartsWith("https://www.facebook.com/", transaction.Response.Headers.Location.OriginalString); 1068var locationUri = transaction.Response.Headers.Location;
MicrosoftAccountTests.cs (7)
66var query = transaction.Response.Headers.Location.Query; 120var location = transaction.Response.Headers.Location.AbsoluteUri; 146Assert.Contains("scope=foo%20bar", res.Headers.Location.Query); 164Assert.Contains("scope=baz%20qux", res.Headers.Location.Query); 182Assert.Contains("scope=baz%20qux", res.Headers.Location.Query); 270var query = QueryHelpers.ParseQuery(transaction.Response.Headers.Location.Query); 335var locationUri = transaction.Response.Headers.Location;
OAuthTests.cs (10)
135Assert.NotNull(res.Headers.Location); 163Assert.NotNull(res.Headers.Location); 193Assert.Contains("scope=foo%20bar", res.Headers.Location.Query); 219Assert.Contains("prompt=login&audience=https%3A%2F%2Fapi.example.com", res.Headers.Location.Query); 248Assert.Contains("scope=baz%20qux", res.Headers.Location.Query); 277Assert.Contains("scope=baz%20qux", res.Headers.Location.Query); 314Assert.Equal("https://www.example.com/access-denied?ReturnUrl=http%3A%2F%2Ftesthost%2Fredirect", transaction.Response.Headers.Location.ToString()); 349Assert.Null(transaction.Response.Headers.Location); 385Assert.Null(transaction.Response.Headers.Location); 421Assert.Null(transaction.Response.Headers.Location);
OpenIdConnect\OpenIdConnectChallengeTests.cs (56)
37Assert.NotNull(res.Headers.Location); 40res.Headers.Location, 70Assert.NotNull(res.Headers.Location); 74Assert.Contains("code_challenge=", res.Headers.Location.Query); 75Assert.Contains("code_challenge_method=S256", res.Headers.Location.Query); 79Assert.DoesNotContain("code_challenge=", res.Headers.Location.Query); 80Assert.DoesNotContain("code_challenge_method=", res.Headers.Location.Query); 105Assert.NotNull(res.Headers.Location); 107Assert.DoesNotContain("code_challenge=", res.Headers.Location.Query); 108Assert.DoesNotContain("code_challenge_method=", res.Headers.Location.Query); 126Assert.DoesNotContain(OpenIdConnectParameterNames.SkuTelemetry, res.Headers.Location.Query); 127Assert.DoesNotContain(OpenIdConnectParameterNames.VersionTelemetry, res.Headers.Location.Query); 198Assert.NotNull(res.Headers.Location); 200var values = settings.ValidateChallengeRedirect(res.Headers.Location); 233Assert.NotNull(res.Headers.Location); 235var values = settings.ValidateChallengeRedirect(res.Headers.Location); 276Assert.NotNull(res.Headers.Location); 279res.Headers.Location, 313Assert.NotNull(res.Headers.Location); 316res.Headers.Location, 322var actual = res.Headers.Location.Query.Trim('?').Split('&').Single(seg => seg.StartsWith($"{OpenIdConnectParameterNames.ClientId}=", StringComparison.Ordinal)); 357Assert.NotNull(res.Headers.Location); 361Assert.Equal(newMessage.TestAuthorizeEndpoint, res.Headers.Location.AbsoluteUri); 392Assert.Null(res.Headers.Location); 421Assert.Null(res.Headers.Location); 491res.Headers.Location, 513res.Headers.Location, 533settings.ValidateChallengeRedirect(res.Headers.Location, OpenIdConnectParameterNames.Prompt); 534Assert.Contains("prompt=consent", res.Headers.Location.Query); 557settings.ValidateChallengeRedirect(res.Headers.Location); 558Assert.Contains("prompt=login", res.Headers.Location.Query); 579settings.ValidateChallengeRedirect(res.Headers.Location); 580Assert.Contains("prompt=login", res.Headers.Location.Query); 603settings.ValidateChallengeRedirect(res.Headers.Location); 604Assert.Contains("scope=baz%20qux", res.Headers.Location.Query); 627settings.ValidateChallengeRedirect(res.Headers.Location); 628Assert.Contains("scope=baz%20qux", res.Headers.Location.Query); 651settings.ValidateChallengeRedirect(res.Headers.Location); 652Assert.Contains("max_age=1234", res.Headers.Location.Query); 673settings.ValidateChallengeRedirect(res.Headers.Location); 674Assert.Contains("max_age=1234", res.Headers.Location.Query); 694settings.ValidateChallengeRedirect(res.Headers.Location); 695Assert.Contains("prompt=login&audience=https%3A%2F%2Fapi.example.com", res.Headers.Location.Query); 723Assert.Contains("request_uri=my_reference_value", res.Headers.Location.Query); 724Assert.Contains("client_id=Test%20Id", res.Headers.Location.Query); 727Assert.DoesNotContain("redirect_uri", res.Headers.Location.Query); 728Assert.DoesNotContain("scope", res.Headers.Location.Query); 729Assert.DoesNotContain("client_secret", res.Headers.Location.Query); 813Assert.DoesNotContain("request_uri=my_reference_value", res.Headers.Location.Query); 817Assert.Contains("redirect_uri", res.Headers.Location.Query); 818Assert.Contains("scope", res.Headers.Location.Query); 851Assert.Contains("request_uri=request_uri_from_event", res.Headers.Location.Query); 886Assert.DoesNotContain("scope", res.Headers.Location.Query); 917Assert.Contains("request_uri=my_reference_value", res.Headers.Location.Query); 918Assert.Contains("client_id=Test%20Id", res.Headers.Location.Query); 921Assert.DoesNotContain("prompt", res.Headers.Location.Query);
OpenIdConnect\OpenIdConnectEventTests.cs (5)
970Assert.Equal("http://testhost/end", response.Headers.Location.GetLeftPart(UriPartial.Path)); 997Assert.Null(response.Headers.Location); 1083Assert.Equal("http://testhost/redirect", response.Headers.Location.AbsoluteUri); 1106Assert.Null(response.Headers.Location); 1133Assert.Null(response.Headers.Location);
OpenIdConnect\OpenIdConnectEventTests_Handler.cs (5)
970Assert.Equal("http://testhost/end", response.Headers.Location.GetLeftPart(UriPartial.Path)); 997Assert.Null(response.Headers.Location); 1083Assert.Equal("http://testhost/redirect", response.Headers.Location.AbsoluteUri); 1106Assert.Null(response.Headers.Location); 1133Assert.Null(response.Headers.Location);
OpenIdConnect\OpenIdConnectTests.cs (12)
51Assert.NotNull(res.Headers.Location); 54transaction.Response.Headers.Location, 78Assert.NotNull(res.Headers.Location); 105Assert.NotNull(res.Headers.Location); 131Assert.NotNull(res.Headers.Location); 158Assert.NotNull(res.Headers.Location); 183Assert.DoesNotContain(OpenIdConnectParameterNames.SkuTelemetry, res.Headers.Location.Query); 184Assert.DoesNotContain(OpenIdConnectParameterNames.VersionTelemetry, res.Headers.Location.Query); 185setting.ValidateSignoutRedirect(transaction.Response.Headers.Location); 220settings.ValidateSignoutRedirect(transaction.Response.Headers.Location, 242var query = transaction.Response.Headers.Location.Query.Substring(1).Split('&') 273var query = transaction.Response.Headers.Location.Query.Substring(1).Split('&')
TwitterTests.cs (6)
72var query = transaction.Response.Headers.Location.Query; 182var location = transaction.Response.Headers.Location.AbsoluteUri; 210var location = transaction.Response.Headers.Location.AbsoluteUri; 224Assert.Equal("http://localhost/access-denied?ReturnUrl=%2Fchallenge", response.Headers.Location.ToString()); 260var location = transaction.Response.Headers.Location.AbsoluteUri; 367var location = transaction.Response.Headers.Location.AbsoluteUri;
WsFederation\WsFederationTest.cs (11)
76Assert.Equal("https://login.windows.net/4afbc689-805b-48cf-a24c-d4aa3248a248/wsfed", response.Headers.Location.GetLeftPart(System.UriPartial.Path)); 77var queryItems = QueryHelpers.ParseQuery(response.Headers.Location.Query); 92Assert.Equal("https://login.windows.net/4afbc689-805b-48cf-a24c-d4aa3248a248/wsfed", response.Headers.Location.GetLeftPart(System.UriPartial.Path)); 93var queryItems = QueryHelpers.ParseQuery(response.Headers.Location.Query); 108Assert.Equal("https://login.windows.net/4afbc689-805b-48cf-a24c-d4aa3248a248/wsfed", response.Headers.Location.GetLeftPart(System.UriPartial.Path)); 109var queryItems = QueryHelpers.ParseQuery(response.Headers.Location.Query); 124var queryItems = QueryHelpers.ParseQuery(response.Headers.Location.Query); 133request = new HttpRequestMessage(HttpMethod.Get, response.Headers.Location); 160var request = new HttpRequestMessage(HttpMethod.Get, response.Headers.Location); 175var queryItems = QueryHelpers.ParseQuery(response.Headers.Location.Query); 234Assert.Contains("CustomKey=CustomValue", result.Headers.Location.Query);
WsFederation\WsFederationTest_Handler.cs (11)
74Assert.Equal("https://login.windows.net/4afbc689-805b-48cf-a24c-d4aa3248a248/wsfed", response.Headers.Location.GetLeftPart(System.UriPartial.Path)); 75var queryItems = QueryHelpers.ParseQuery(response.Headers.Location.Query); 90Assert.Equal("https://login.windows.net/4afbc689-805b-48cf-a24c-d4aa3248a248/wsfed", response.Headers.Location.GetLeftPart(System.UriPartial.Path)); 91var queryItems = QueryHelpers.ParseQuery(response.Headers.Location.Query); 106Assert.Equal("https://login.windows.net/4afbc689-805b-48cf-a24c-d4aa3248a248/wsfed", response.Headers.Location.GetLeftPart(System.UriPartial.Path)); 107var queryItems = QueryHelpers.ParseQuery(response.Headers.Location.Query); 122var queryItems = QueryHelpers.ParseQuery(response.Headers.Location.Query); 131request = new HttpRequestMessage(HttpMethod.Get, response.Headers.Location); 158var request = new HttpRequestMessage(HttpMethod.Get, response.Headers.Location); 173var queryItems = QueryHelpers.ParseQuery(response.Headers.Location.Query); 232Assert.Contains("CustomKey=CustomValue", result.Headers.Location.Query);
Microsoft.AspNetCore.HttpsPolicy.Tests (7)
HttpsPolicyTests.cs (2)
70Assert.Equal(expectedUrl, response.Headers.Location.ToString()); 73client.BaseAddress = new Uri(response.Headers.Location.ToString());
HttpsRedirectionMiddlewareTests.cs (5)
111Assert.Equal(expected, response.Headers.Location.ToString()); 167Assert.Equal(expectedUrl, response.Headers.Location.ToString()); 228Assert.Equal(expectedUrl, response.Headers.Location.ToString()); 268Assert.Equal("https://localhost:5050/", response.Headers.Location.ToString()); 356Assert.Equal("https://localhost:5050/", response.Headers.Location.ToString());
Microsoft.AspNetCore.Identity.FunctionalTests (1)
Extensions\ResponseAssert.cs (1)
18return responseMessage.Headers.Location;
Microsoft.AspNetCore.Mvc.FunctionalTests (53)
AntiforgeryAuthTests.cs (2)
39Assert.Equal("/Home/Login", response.Headers.Location.AbsolutePath, StringComparer.OrdinalIgnoreCase); 51Assert.Equal("/Home/Login", response.Headers.Location.AbsolutePath, StringComparer.OrdinalIgnoreCase);
AntiforgeryTests.cs (1)
210Assert.Equal("http://example.com/antiforgery-redirect", response.Headers.Location.AbsoluteUri);
ApplicationModelTest.cs (1)
175Assert.Equal("/Home/CannotBeRouted", response.Headers.Location.ToString());
AuthMiddlewareAndFilterTestBase.cs (2)
268Assert.Equal("/Account/Login", response.Headers.Location.LocalPath); 274Assert.Equal("/Account/AccessDenied", response.Headers.Location.LocalPath);
AuthMiddlewareUsingRequireAuthTest.cs (1)
76Assert.Equal("/Home/Login", response.Headers.Location.LocalPath);
BasicTests.cs (4)
194Assert.NotNull(response.Headers.Location); 195Assert.Equal("https://localhost/Home/HttpsOnlyAction", response.Headers.Location.ToString()); 408Assert.NotNull(response.Headers.Location); 409Assert.Equal("/Home/Product", response.Headers.Location.ToString());
ComponentRenderingFunctionalTests.cs (1)
76Assert.Equal("http://localhost/navigation-redirect", response.Headers.Location.ToString());
GlobalAuthorizationFilterTestBase.cs (3)
42Assert.NotNull(response.Headers.Location); 45response.Headers.Location.ToString()); 80Assert.Null(response.Headers.Location);
LinkGenerationTests.cs (1)
69response.Headers.Location);
RazorPagesTest.cs (18)
508request = new HttpRequestMessage(HttpMethod.Get, response.Headers.Location); 533request = new HttpRequestMessage(HttpMethod.Get, response.Headers.Location); 558request = new HttpRequestMessage(HttpMethod.Get, response.Headers.Location); 618Assert.Equal("/Login?ReturnUrl=%2FHelloWorldWithAuth", response.Headers.Location.PathAndQuery); 961Assert.Equal(expected, response.Headers.Location.ToString()); 975Assert.Equal(expected, response.Headers.Location.ToString()); 997Assert.Equal(expected, response.Headers.Location.ToString()); 1011Assert.Equal(expected, response.Headers.Location.ToString()); 1025Assert.Equal(expected, response.Headers.Location.ToString()); 1039Assert.Equal(expected, response.Headers.Location.ToString()); 1053Assert.Equal(expected, response.Headers.Location.ToString()); 1065Assert.Equal(expected, response.Headers.Location.ToString()); 1077Assert.Equal(expected, response.Headers.Location.ToString()); 1089Assert.Equal(expected, response.Headers.Location.ToString()); 1103Assert.Equal(expected, response.Headers.Location.ToString()); 1115Assert.Equal(expected, response.Headers.Location.ToString()); 1214Assert.Equal("/Login?ReturnUrl=%2FPages%2FModelWithAuthFilter", response.Headers.Location.PathAndQuery); 1225Assert.Equal("/Login?ReturnUrl=%2FPages%2FAdmin%2FEdit", response.Headers.Location.PathAndQuery);
RazorPagesWithBasePathTest.cs (8)
114Assert.Equal("/Login?ReturnUrl=%2FConventions%2FAuth", response.Headers.Location.PathAndQuery); 125Assert.Equal("/Login?ReturnUrl=%2FConventions%2FAuthFolder", response.Headers.Location.PathAndQuery); 260Assert.Equal(expected, response.Headers.Location.ToString()); 274Assert.Equal(expected, response.Headers.Location.ToString()); 393Assert.Equal("/Login?ReturnUrl=%2FAccounts%2FRequiresAuth", response.Headers.Location.PathAndQuery); 478Assert.Equal("/", response.Headers.Location.ToString()); 727Assert.Equal("/Login?ReturnUrl=%2FFilters%2FAuthFilterOnPage", response.Headers.Location.PathAndQuery); 738Assert.Equal("/Login?ReturnUrl=%2FFilters%2FAuthFilterOnPageWithModel", response.Headers.Location.PathAndQuery);
RazorPagesWithEndpointRoutingTest.cs (3)
38Assert.Equal("/Login?ReturnUrl=%2FConventions%2FAuthFolder", response.Headers.Location.PathAndQuery); 62Assert.Equal("/Login?ReturnUrl=%2FModelWithAuthFilter", response.Headers.Location.PathAndQuery); 73Assert.Equal("/Login?ReturnUrl=%2FAuthorizedAction%2FIndex", response.Headers.Location.PathAndQuery);
SimpleWithWebApplicationBuilderTests.cs (2)
93Assert.Equal("/ok-object", response.Headers.Location.ToString()); 120Assert.Equal("/json", response.Headers.Location.ToString());
TempDataInCookiesTest.cs (1)
145response = await Client.SendAsync(GetRequest(redirectResponse.Headers.Location.ToString(), response));
TempDataPropertyTest.cs (2)
51var response = await Client.SendAsync(GetRequest(redirectResponse.Headers.Location.ToString(), redirectResponse)); 79var response = await Client.SendAsync(GetRequest(redirectResponse.Headers.Location.ToString(), redirectResponse));
TempDataTestBase.cs (2)
108response = await Client.SendAsync(GetRequest(redirectResponse.Headers.Location.ToString(), response)); 173var response = await Client.SendAsync(GetRequest(redirectResponse.Headers.Location.ToString(), redirectResponse));
TestingInfrastructureTests.cs (1)
123Assert.Equal("/Testing/Builder", response.Headers.Location?.OriginalString);
Microsoft.AspNetCore.Mvc.Testing (1)
Handlers\RedirectHandler.cs (1)
139var location = response.Headers.Location;
Microsoft.AspNetCore.Rewrite.Tests (37)
ApacheModRewrite\ModRewriteMiddlewareTest.cs (4)
353Assert.Equal(@"https://www.example.com/foo/", response.Headers.Location.AbsoluteUri); 381Assert.Equal("/", response.Headers.Location.OriginalString); 435Assert.Equal("/foo", response.Headers.Location.OriginalString); 464Assert.Equal("http://localhost:80/home/report/123", response.Headers.Location.OriginalString);
IISUrlRewrite\MiddleWareTests.cs (10)
47Assert.Equal("/article.aspx?id=10&title=hey", response.Headers.Location.OriginalString); 147Assert.Equal("/hello", response.Headers.Location.OriginalString); 182Assert.Equal("/hey/hello", response.Headers.Location.OriginalString); 217Assert.Equal("/hey/hello/", response.Headers.Location.OriginalString); 251Assert.Equal("https://example.com/", response.Headers.Location.OriginalString); 365Assert.Equal("/", response.Headers.Location.OriginalString); 434Assert.Equal("/foo", response.Headers.Location.OriginalString); 472Assert.Equal("/hey/hello/", response.Headers.Location.OriginalString); 508Assert.Equal("/blogposts/article/abc?p1=123&p2=abc", response.Headers.Location.OriginalString); 544Assert.Equal("/blog/article/23/abc?p1=123&p2=abc", response.Headers.Location.OriginalString);
MiddlewareTests.cs (23)
174Assert.Equal(expectedUrl, response.Headers.Location.OriginalString); 204Assert.Equal("http://example.com/foo", response.Headers.Location.OriginalString); 228Assert.Equal("http://example.com/foo?bar=1", response.Headers.Location.OriginalString); 256Assert.Equal("https://example.com/", response.Headers.Location.OriginalString); 285Assert.Equal($"https://example.com:{sslPort.GetValueOrDefault().ToString(CultureInfo.InvariantCulture)}/", response.Headers.Location.OriginalString); 289Assert.Equal("https://example.com/", response.Headers.Location.OriginalString); 329Assert.Equal("https://" + expectedHostPathAndQuery, response.Headers.Location.OriginalString); 359Assert.Equal(redirectReplacement, response.Headers.Location.OriginalString); 383Assert.Equal("https://example.com/", response.Headers.Location.OriginalString); 410Assert.Equal(expected, response.Headers.Location.OriginalString); 439Assert.Equal("https://www.example.com/", response.Headers.Location.OriginalString); 468Assert.Equal(redirectUri, response.Headers.Location.OriginalString); 493Assert.Equal("https://www.example.com/", response.Headers.Location.OriginalString); 528Assert.Null(response.Headers.Location); 556Assert.Equal("https://example.com/", response.Headers.Location.OriginalString); 585Assert.Equal(redirectUri, response.Headers.Location.OriginalString); 610Assert.Equal("https://example.com/", response.Headers.Location.OriginalString); 634Assert.Equal("/", response.Headers.Location.OriginalString); 726Assert.Equal("/foo", response.Headers.Location.OriginalString); 755Assert.Null(response.Headers.Location); 783Assert.Equal(redirectUri, response.Headers.Location.OriginalString); 808Assert.Equal("https://www.example.com/", response.Headers.Location.OriginalString); 837Assert.Equal("https://www.example.com/", response.Headers.Location.OriginalString);
System.Net.Http (1)
System\Net\Http\SocketsHttpHandler\RedirectHandler.cs (1)
107Uri? location = response.Headers.Location;