116 references to PostAsJsonAsync
Microsoft.AspNetCore.Identity.FunctionalTests (114)
MapIdentityApiTests.cs (114)
46
AssertOkAndEmpty(await client.
PostAsJsonAsync
("/identity/register", new { Email, Password }));
55
AssertBadRequestAndEmpty(await client.
PostAsJsonAsync
("/identity/register", new { Password }));
65
await AssertValidationProblemAsync(await client.
PostAsJsonAsync
("/identity/register", new { Email = "invalid", Password }),
76
AssertOkAndEmpty(await client.
PostAsJsonAsync
("/identity/register", new { Email, Password }));
77
await AssertValidationProblemAsync(await client.
PostAsJsonAsync
("/identity/register", new { Email, Password }),
87
await AssertProblemAsync(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password }),
98
await AssertProblemAsync(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password = "wrong" }),
110
var loginResponse = await client.
PostAsJsonAsync
("/identity/login", new { Email, Password });
143
var loginResponse = await client.
PostAsJsonAsync
("/identity/login", new { Email, Password });
180
var loginResponse = await client.
PostAsJsonAsync
("/identity/login", new { Email, Password });
211
var loginResponse = await client.
PostAsJsonAsync
("/identity/login?useCookies=true", new { Email, Password });
236
=> client.
PostAsJsonAsync
("/identity/login?useCookies=true", new { Email, Password }));
259
var loginResponse = await client.
PostAsJsonAsync
("/identity/login", new { Email, Password });
295
var loginResponse = await client.
PostAsJsonAsync
("/identity/login", new { Email, Password });
299
var refreshResponse = await client.
PostAsJsonAsync
("/identity/refresh", new { refreshToken });
314
AssertUnauthorizedAndEmpty(await client.
PostAsJsonAsync
("/identity/refresh", new { refreshToken }));
317
AssertUnauthorizedAndEmpty(await client.
PostAsJsonAsync
("/identity/refresh", new { refreshToken }));
340
var loginResponse = await client.
PostAsJsonAsync
("/identity/login", new { Email, Password });
347
var refreshResponse = await client.
PostAsJsonAsync
("/identity/refresh", new { refreshToken });
353
refreshResponse = await client.
PostAsJsonAsync
("/identity/refresh", new { refreshToken });
363
AssertUnauthorizedAndEmpty(await client.
PostAsJsonAsync
("/identity/refresh", new { refreshToken }));
369
refreshResponse = await client.
PostAsJsonAsync
("/identity/refresh", new { refreshToken });
393
AssertUnauthorizedAndEmpty(await client.
PostAsJsonAsync
("/identity/refresh", new { refreshToken }));
414
var refreshResponse = await client.
PostAsJsonAsync
("/identity/refresh", new { refreshToken });
437
await AssertProblemAsync(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password = "wrong" }),
440
await AssertProblemAsync(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password = "wrong" }),
447
await AssertProblemAsync(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password }),
467
await AssertProblemAsync(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password = "wrong" }),
474
AssertOk(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password }));
549
await AssertProblemAsync(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password }),
552
AssertOk(await client.
PostAsJsonAsync
("/identity/resendConfirmationEmail", new { Email = "wrong" }));
553
AssertOk(await client.
PostAsJsonAsync
("/identity/resendConfirmationEmail", new { Email = Email }));
562
AssertOk(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password }));
670
var loginResponse = await client.
PostAsJsonAsync
("/identity/login", new { Email, Password });
681
await AssertValidationProblemAsync(await client.
PostAsJsonAsync
("/identity/manage/2fa", new { Enable = true }),
683
await AssertValidationProblemAsync(await client.
PostAsJsonAsync
("/identity/manage/2fa", new { Enable = true, TwoFactorCode = "wrong" }),
688
AssertBadRequestAndEmpty(await client.
PostAsJsonAsync
<object?>("/identity/manage/2fa", null));
690
var twoFactorKeyResponse = await client.
PostAsJsonAsync
("/identity/manage/2fa", new object());
702
var enable2faResponse = await client.
PostAsJsonAsync
("/identity/manage/2fa", new { twoFactorCode, Enable = true });
711
AssertUnauthorizedAndEmpty(await client.
PostAsJsonAsync
("/identity/refresh", new { refreshToken }));
715
await AssertProblemAsync(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password }),
718
AssertOk(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password, twoFactorCode }));
728
var loginResponse = await client.
PostAsJsonAsync
("/identity/login", new { Email, Password });
734
var twoFactorKeyResponse = await client.
PostAsJsonAsync
("/identity/manage/2fa", new object());
743
var enable2faResponse = await client.
PostAsJsonAsync
("/identity/manage/2fa", new { twoFactorCode, Enable = true });
752
await AssertProblemAsync(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password }),
755
var recoveryLoginResponse = await client.
PostAsJsonAsync
("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[0] });
763
var disable2faResponse = await client.
PostAsJsonAsync
("/identity/manage/2fa", new { Enable = false });
769
AssertOk(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password }));
780
var loginResponse = await client.
PostAsJsonAsync
("/identity/login", new { Email, Password });
786
var twoFactorKeyResponse = await client.
PostAsJsonAsync
("/identity/manage/2fa", new object());
795
await AssertValidationProblemAsync(await client.
PostAsJsonAsync
("/identity/manage/2fa", new { twoFactorCode, Enable = true, ResetSharedKey = true }),
798
var enable2faResponse = await client.
PostAsJsonAsync
("/identity/manage/2fa", new { twoFactorCode, Enable = true });
802
var resetKeyResponse = await client.
PostAsJsonAsync
("/identity/manage/2fa", new { ResetSharedKey = true });
812
await AssertValidationProblemAsync(await client.
PostAsJsonAsync
("/identity/manage/2fa", new { twoFactorCode, Enable = true }),
815
var reenable2faResponse = await client.
PostAsJsonAsync
("/identity/manage/2fa", new { TwoFactorCode = resetTwoFactorCode, Enable = true });
827
var loginResponse = await client.
PostAsJsonAsync
("/identity/login", new { Email, Password });
833
var twoFactorKeyResponse = await client.
PostAsJsonAsync
("/identity/manage/2fa", new object());
842
var enable2faResponse = await client.
PostAsJsonAsync
("/identity/manage/2fa", new { twoFactorCode, Enable = true });
850
await AssertProblemAsync(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password }),
853
AssertOk(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[0] }));
855
await AssertProblemAsync(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[0] }),
858
var recoveryLoginResponse = await client.
PostAsJsonAsync
("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[1] });
865
var updated2faResponse = await client.
PostAsJsonAsync
("/identity/manage/2fa", new object());
870
await AssertValidationProblemAsync(await client.
PostAsJsonAsync
("/identity/manage/2fa", new { twoFactorCode, Enable = true, ResetSharedKey = true }),
873
var resetRecoveryResponse = await client.
PostAsJsonAsync
("/identity/manage/2fa", new { ResetRecoveryCodes = true });
882
AssertOk(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password, TwoFactorRecoveryCode = resetRecoveryCodes[0] }));
885
await AssertProblemAsync(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[2] }),
896
var loginResponse = await client.
PostAsJsonAsync
("/identity/login?useCookies=true", new { Email, Password });
899
var twoFactorKeyResponse = await client.
PostAsJsonAsync
("/identity/manage/2fa", new object());
911
var enable2faResponse = await client.
PostAsJsonAsync
("/identity/manage/2fa", new { twoFactorCode, Enable = true });
916
await AssertProblemAsync(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password }),
920
var sessionLoginResponse = await client.
PostAsJsonAsync
("/identity/login?useSessionCookies=true", new { Email, Password, twoFactorCode });
923
var session2faResponse = await client.
PostAsJsonAsync
("/identity/manage/2fa", new object());
929
var sessionLoginResponse2 = await client.
PostAsJsonAsync
("/identity/login?useCookies=true&useSessionCookies=true", new { Email, Password, twoFactorCode });
932
var session2faResponse2 = await client.
PostAsJsonAsync
("/identity/manage/2fa", new object());
938
var persistentLoginResponse = await client.
PostAsJsonAsync
("/identity/login?useCookies=true", new { Email, Password, twoFactorCode });
941
var persistent2faResponse = await client.
PostAsJsonAsync
("/identity/manage/2fa", new object());
975
AssertOkAndEmpty(await client.
PostAsJsonAsync
("/identity/forgotPassword", new { Email = confirmedEmail }));
976
AssertOkAndEmpty(await client.
PostAsJsonAsync
("/identity/forgotPassword", new { Email = unconfirmedEmail }));
977
AssertOkAndEmpty(await client.
PostAsJsonAsync
("/identity/forgotPassword", new { Email = "wrong" }));
990
AssertBadRequestAndEmpty(await client.
PostAsJsonAsync
("/identity/resetPassword", new { Email = confirmedEmail, resetCode }));
991
AssertBadRequestAndEmpty(await client.
PostAsJsonAsync
("/identity/resetPassword", new { Email = unconfirmedEmail, resetCode }));
992
AssertBadRequestAndEmpty(await client.
PostAsJsonAsync
("/identity/resetPassword", new { Email = "wrong", resetCode }));
994
await AssertValidationProblemAsync(await client.
PostAsJsonAsync
("/identity/resetPassword", new { Email = confirmedEmail, ResetCode = "wrong", newPassword }),
996
await AssertValidationProblemAsync(await client.
PostAsJsonAsync
("/identity/resetPassword", new { Email = unconfirmedEmail, ResetCode = "wrong", newPassword }),
998
await AssertValidationProblemAsync(await client.
PostAsJsonAsync
("/identity/resetPassword", new { Email = "wrong", ResetCode = "wrong", newPassword }),
1002
await AssertValidationProblemAsync(await client.
PostAsJsonAsync
("/identity/resetPassword", new { Email = confirmedEmail, ResetCode = "wrong", NewPassword = "" }),
1004
await AssertProblemAsync(await client.
PostAsJsonAsync
("/identity/resetPassword", new { Email = confirmedEmail, resetCode, NewPassword = "" }),
1007
AssertOkAndEmpty(await client.
PostAsJsonAsync
("/identity/resetPassword", new { Email = confirmedEmail, resetCode, newPassword }));
1010
await AssertProblemAsync(await client.
PostAsJsonAsync
("/identity/login", new { Email = confirmedEmail, Password }),
1014
AssertOk(await client.
PostAsJsonAsync
("/identity/login", new { Email = confirmedEmail, Password = newPassword }));
1052
await AssertValidationProblemAsync(await client.
PostAsJsonAsync
("/identity/manage/info", new { NewEmail = "invalid" }),
1055
var infoPostResponse = await client.
PostAsJsonAsync
("/identity/manage/info", new { newEmail });
1068
await AssertProblemAsync(await client.
PostAsJsonAsync
("/identity/login", new { Email = newEmail, Password }),
1072
AssertOk(await client.
PostAsJsonAsync
("/identity/refresh", new { RefreshToken = originalRefreshToken }));
1094
AssertUnauthorizedAndEmpty(await client.
PostAsJsonAsync
("/identity/refresh", new { RefreshToken = originalRefreshToken }));
1132
var loginResponse = await client.
PostAsJsonAsync
("/identity/login?useCookies=true", new { Email, Password });
1146
var infoPostResponse = await client.
PostAsJsonAsync
("/identity/manage/info", new { newEmail });
1182
var secondLoginResponse = await client.
PostAsJsonAsync
("/identity/login?useCookies=true", new { Email = newEmail, Password });
1205
await AssertValidationProblemAsync(await client.
PostAsJsonAsync
("/identity/manage/info", new { newPassword }),
1207
AssertOk(await client.
PostAsJsonAsync
("/identity/manage/info", new { OldPassword = Password, newPassword }));
1212
await AssertProblemAsync(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password }),
1214
AssertOk(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password = newPassword }));
1240
await AssertValidationProblemAsync(await client.
PostAsJsonAsync
("/identity/manage/info", new { newPassword, newEmail }),
1247
var infoPostResponse = await client.
PostAsJsonAsync
("/identity/manage/info", new { OldPassword = Password, newPassword, newEmail });
1255
await AssertProblemAsync(await client.
PostAsJsonAsync
("/identity/login", new { Email = newEmail, Password = newPassword }),
1258
await AssertProblemAsync(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password }),
1261
AssertOk(await client.
PostAsJsonAsync
("/identity/login", new { Email, Password = newPassword }));
1274
AssertOk(await client.
PostAsJsonAsync
("/identity/login", new { Email = newEmail, Password = newPassword }));
1385
AssertOkAndEmpty(await client.
PostAsJsonAsync
($"{groupPrefix}/register", new { email, Password }));
1393
await client.
PostAsJsonAsync
($"{groupPrefix}/login", new { email, Password });
1394
var loginResponse = await client.
PostAsJsonAsync
("/identity/login", new { email, Password });
1415
await AssertProblemAsync(await client.
PostAsJsonAsync
($"{groupPrefix}/login", new { email, Password }),
Microsoft.AspNetCore.Routing.FunctionalTests (1)
RouteHandlerTest.cs (1)
52
var response = await client.
PostAsJsonAsync
("/EchoTodo/42", todo);
System.Net.Http.Json (1)
System\Net\Http\Json\HttpClientJsonExtensions.Post.cs (1)
43
=> client.
PostAsJsonAsync
(requestUri, value, options: null, cancellationToken);