3 writes to Response
Microsoft.AspNetCore.Authentication.Test (3)
JwtBearerTests.cs (1)
1259
Response
= await server.CreateClient().SendAsync(request),
JwtBearerTests_Handler.cs (1)
1318
Response
= await server.CreateClient().SendAsync(request),
TestExtensions.cs (1)
28
Response
= await server.CreateClient().SendAsync(request),
248 references to Response
Microsoft.AspNetCore.Authentication.Test (248)
CookieTests.cs (18)
1252
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
1254
var location = transaction.
Response
.Headers.Location;
1287
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
1314
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
1342
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
1365
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
1388
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
1391
var location = transaction.
Response
.Headers.Location;
1413
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
1436
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
1439
var location = transaction.
Response
.Headers.Location;
1461
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
1463
var location = transaction.
Response
.Headers.Location;
1486
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
1488
var location = transaction.
Response
.Headers.Location;
1628
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
1630
var location = transaction.
Response
.Headers.Location;
1731
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
FacebookTests.cs (19)
58
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
74
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
110
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
111
var query = transaction.
Response
.Headers.Location.Query;
139
var res = transaction.
Response
;
171
var res = transaction.
Response
;
203
var res = transaction.
Response
;
231
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
232
var location = transaction.
Response
.Headers.Location.AbsoluteUri;
264
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
265
var location = transaction.
Response
.Headers.Location.AbsoluteUri;
299
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
300
var location = transaction.
Response
.Headers.Location.AbsoluteUri;
366
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
367
Assert.Equal("/me", transaction.
Response
.Headers.GetValues("Location").First());
434
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
435
var locationUri = transaction.
Response
.Headers.Location;
448
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
449
Assert.Equal("/challenge", transaction.
Response
.Headers.GetValues("Location").First());
GoogleTests.cs (59)
55
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
56
var location = transaction.
Response
.Headers.Location;
86
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
99
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
112
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
125
Assert.Equal(HttpStatusCode.Unauthorized, transaction.
Response
.StatusCode);
151
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
152
var query = transaction.
Response
.Headers.Location.Query;
187
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
190
var query = QueryHelpers.ParseQuery(transaction.
Response
.Headers.Location.Query);
239
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
242
var query = QueryHelpers.ParseQuery(transaction.
Response
.Headers.Location.Query);
295
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
298
var query = QueryHelpers.ParseQuery(transaction.
Response
.Headers.Location.Query);
334
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
335
var query = transaction.
Response
.Headers.Location.Query;
359
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
401
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
402
Assert.Equal("/error?FailureMessage=AccessDenied", transaction.
Response
.Headers.GetValues("Location").First());
437
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
438
Assert.Equal("https://example.com/custom-denied-page?rurl=http%3A%2F%2Fwww.google.com%2F", transaction.
Response
.Headers.GetValues("Location").First());
480
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
481
Assert.StartsWith("/error?FailureMessage=", transaction.
Response
.Headers.GetValues("Location").First());
519
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
520
Assert.Equal("/error?FailureMessage=itfailed" + UrlEncoder.Default.Encode(";Description=whyitfailed;Uri=https://example.com/fail"), transaction.
Response
.Headers.GetValues("Location").First());
558
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
559
Assert.Equal("/me", transaction.
Response
.Headers.GetValues("Location").First());
566
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
578
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
628
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
630
transaction.
Response
.Headers.GetValues("Location").First());
680
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
682
transaction.
Response
.Headers.GetValues("Location").First());
721
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
722
Assert.Equal("/me", transaction.
Response
.Headers.GetValues("Location").First());
729
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
761
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
762
Assert.Equal("/", transaction.
Response
.Headers.GetValues("Location").First());
809
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
810
Assert.Equal("/foo", transaction.
Response
.Headers.GetValues("Location").First());
852
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
854
transaction.
Response
.Headers.GetValues("Location").First());
882
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
883
Assert.Equal("/me", transaction.
Response
.Headers.GetValues("Location").First());
890
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
926
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
927
Assert.Equal("/me", transaction.
Response
.Headers.GetValues("Location").First());
934
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
970
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
971
Assert.Equal("/me", transaction.
Response
.Headers.GetValues("Location").First());
978
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
1007
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
1008
Assert.Equal("/me", transaction.
Response
.Headers.GetValues("Location").First());
1015
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
1016
Assert.StartsWith("https://www.facebook.com/", transaction.
Response
.Headers.Location.OriginalString);
1067
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
1068
var locationUri = transaction.
Response
.Headers.Location;
1081
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
1082
Assert.Equal("/challenge", transaction.
Response
.Headers.GetValues("Location").First());
JwtBearerTests.cs (45)
81
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
119
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
120
Assert.Equal(tokenText, await response.
Response
.Content.ReadAsStringAsync());
163
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
172
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
216
Assert.Equal(HttpStatusCode.Unauthorized, transaction.
Response
.StatusCode);
246
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
256
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
265
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
274
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
292
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
293
Assert.Equal("Bearer error=\"invalid_token\"", response.
Response
.Headers.WwwAuthenticate.First().ToString());
319
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
320
Assert.Equal($"Bearer error=\"invalid_token\", error_description=\"{message}\"", response.
Response
.Headers.WwwAuthenticate.First().ToString());
343
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
344
Assert.Equal($"Bearer error=\"invalid_token\", error_description=\"{message}\"", response.
Response
.Headers.WwwAuthenticate.First().ToString());
363
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
364
Assert.Equal("Bearer error=\"invalid_token\"", response.
Response
.Headers.WwwAuthenticate.First().ToString());
383
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
385
response.
Response
.Headers.WwwAuthenticate.First().ToString());
416
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
451
Assert.Equal(builder.ToString(), response.
Response
.Headers.WwwAuthenticate.First().ToString());
465
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
466
Assert.Equal("Bearer", response.
Response
.Headers.WwwAuthenticate.First().ToString());
477
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
478
Assert.Equal("Bearer", response.
Response
.Headers.WwwAuthenticate.First().ToString());
517
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
546
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
580
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
652
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
724
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
784
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
785
Assert.Empty(response.
Response
.Headers.WwwAuthenticate);
807
Assert.Equal(HttpStatusCode.Forbidden, response.
Response
.StatusCode);
834
Assert.Equal(HttpStatusCode.Forbidden, response.
Response
.StatusCode);
862
Assert.Equal(418, (int)response.
Response
.StatusCode);
863
Assert.Equal("You Shall Not Pass", await response.
Response
.Content.ReadAsStringAsync());
952
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
953
var responseBody = await response.
Response
.Content.ReadAsStringAsync();
996
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
997
var responseBody = await response.
Response
.Content.ReadAsStringAsync();
1262
transaction.ResponseText = await transaction.
Response
.Content.ReadAsStringAsync();
1264
if (transaction.
Response
.Content != null &&
1265
transaction.
Response
.Content.Headers.ContentType != null &&
1266
transaction.
Response
.Content.Headers.ContentType.MediaType == "text/xml")
JwtBearerTests_Handler.cs (45)
72
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
109
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
110
Assert.Equal(tokenText, await response.
Response
.Content.ReadAsStringAsync());
153
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
162
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
203
Assert.Equal(HttpStatusCode.Unauthorized, transaction.
Response
.StatusCode);
232
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
242
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
251
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
260
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
275
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
276
Assert.Equal("Bearer error=\"invalid_token\"", response.
Response
.Headers.WwwAuthenticate.First().ToString());
299
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
300
Assert.Equal($"Bearer error=\"invalid_token\", error_description=\"{message}\"", response.
Response
.Headers.WwwAuthenticate.First().ToString());
320
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
321
Assert.Equal($"Bearer error=\"invalid_token\", error_description=\"{message}\"", response.
Response
.Headers.WwwAuthenticate.First().ToString());
337
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
338
Assert.Equal("Bearer error=\"invalid_token\"", response.
Response
.Headers.WwwAuthenticate.First().ToString());
354
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
356
response.
Response
.Headers.WwwAuthenticate.First().ToString());
386
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
421
Assert.Equal(builder.ToString(), response.
Response
.Headers.WwwAuthenticate.First().ToString());
434
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
435
Assert.Equal("Bearer", response.
Response
.Headers.WwwAuthenticate.First().ToString());
446
Assert.Equal(HttpStatusCode.Unauthorized, response.
Response
.StatusCode);
447
Assert.Equal("Bearer", response.
Response
.Headers.WwwAuthenticate.First().ToString());
483
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
509
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
542
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
610
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
676
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
732
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
733
Assert.Empty(response.
Response
.Headers.WwwAuthenticate);
754
Assert.Equal(HttpStatusCode.Forbidden, response.
Response
.StatusCode);
780
Assert.Equal(HttpStatusCode.Forbidden, response.
Response
.StatusCode);
807
Assert.Equal(418, (int)response.
Response
.StatusCode);
808
Assert.Equal("You Shall Not Pass", await response.
Response
.Content.ReadAsStringAsync());
896
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
897
var responseBody = await response.
Response
.Content.ReadAsStringAsync();
939
Assert.Equal(HttpStatusCode.OK, response.
Response
.StatusCode);
940
var responseBody = await response.
Response
.Content.ReadAsStringAsync();
1321
transaction.ResponseText = await transaction.
Response
.Content.ReadAsStringAsync();
1323
if (transaction.
Response
.Content != null &&
1324
transaction.
Response
.Content.Headers.ContentType != null &&
1325
transaction.
Response
.Content.Headers.ContentType.MediaType == "text/xml")
MicrosoftAccountTests.cs (19)
65
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
66
var query = transaction.
Response
.Headers.Location.Query;
80
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
93
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
106
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
119
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
120
var location = transaction.
Response
.Headers.Location.AbsoluteUri;
144
var res = transaction.
Response
;
162
var res = transaction.
Response
;
180
var res = transaction.
Response
;
243
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
244
Assert.Equal("/me", transaction.
Response
.Headers.GetValues("Location").First());
251
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
267
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
270
var query = QueryHelpers.ParseQuery(transaction.
Response
.Headers.Location.Query);
334
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
335
var locationUri = transaction.
Response
.Headers.Location;
348
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
349
Assert.Equal("/me", transaction.
Response
.Headers.GetValues("Location").First());
OAuthTests.cs (14)
132
var res = transaction.
Response
;
160
var res = transaction.
Response
;
190
var res = transaction.
Response
;
216
var res = transaction.
Response
;
245
var res = transaction.
Response
;
274
var res = transaction.
Response
;
313
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
314
Assert.Equal("https://www.example.com/access-denied?ReturnUrl=http%3A%2F%2Ftesthost%2Fredirect", transaction.
Response
.Headers.Location.ToString());
348
Assert.Equal(HttpStatusCode.NotAcceptable, transaction.
Response
.StatusCode);
349
Assert.Null(transaction.
Response
.Headers.Location);
384
Assert.Equal(HttpStatusCode.NotAcceptable, transaction.
Response
.StatusCode);
385
Assert.Null(transaction.
Response
.Headers.Location);
420
Assert.Equal(HttpStatusCode.NotAcceptable, transaction.
Response
.StatusCode);
421
Assert.Null(transaction.
Response
.Headers.Location);
TestExtensions.cs (6)
30
if (transaction.
Response
.Headers.Contains("Set-Cookie"))
32
transaction.SetCookie = transaction.
Response
.Headers.GetValues("Set-Cookie").ToList();
34
transaction.ResponseText = await transaction.
Response
.Content.ReadAsStringAsync();
36
if (transaction.
Response
.Content != null &&
37
transaction.
Response
.Content.Headers.ContentType != null &&
38
transaction.
Response
.Content.Headers.ContentType.MediaType == "text/xml")
TwitterTests.cs (23)
71
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
72
var query = transaction.
Response
.Headers.Location.Query;
133
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
146
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
159
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
181
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
182
var location = transaction.
Response
.Headers.Location.AbsoluteUri;
209
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
210
var location = transaction.
Response
.Headers.Location.AbsoluteUri;
212
Assert.True(transaction.
Response
.Headers.TryGetValues(HeaderNames.SetCookie, out var setCookie));
259
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
260
var location = transaction.
Response
.Headers.Location.AbsoluteUri;
262
Assert.True(transaction.
Response
.Headers.TryGetValues(HeaderNames.SetCookie, out var setCookie));
366
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
367
var location = transaction.
Response
.Headers.Location.AbsoluteUri;
369
Assert.True(transaction.
Response
.Headers.TryGetValues(HeaderNames.SetCookie, out var setCookie));
431
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
432
Assert.Equal("/me", transaction.
Response
.Headers.GetValues("Location").First());
436
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
444
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);
510
Assert.Equal(HttpStatusCode.Redirect, transaction.
Response
.StatusCode);
511
Assert.Equal("/me", transaction.
Response
.Headers.GetValues("Location").First());
526
Assert.Equal(HttpStatusCode.OK, transaction.
Response
.StatusCode);