MapIdentityApiTests.cs (82)
46AssertOkAndEmpty(await client.PostAsJsonAsync("/identity/register", new { Email, Password }));
76AssertOkAndEmpty(await client.PostAsJsonAsync("/identity/register", new { Email, Password }));
77await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/register", new { Email, Password }),
87await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }),
98await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password = "wrong" }),
110var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password });
125Assert.Equal($"Hello, {Email}!", await client.GetStringAsync("/auth/hello"));
143var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password });
157Assert.Equal($"Hello, {Email}!", await client.GetStringAsync("/auth/hello"));
180var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password });
191Assert.Equal($"Hello, {Email}!", await client.GetStringAsync("/auth/hello"));
196Assert.Equal($"Hello, {Email}!", await client.GetStringAsync("/auth/hello"));
211var loginResponse = await client.PostAsJsonAsync("/identity/login?useCookies=true", new { Email, Password });
224Assert.Equal($"Hello, {Email}!", await client.GetStringAsync("/auth/hello"));
236=> client.PostAsJsonAsync("/identity/login?useCookies=true", new { Email, Password }));
259var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password });
264Assert.Equal($"Hello, {Email}!", await client.GetStringAsync($"/auth/hello?accessToken={accessToken}"));
268Assert.Equal($"Hello, {Email}!", await client.GetStringAsync("/auth/hello"));
295var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password });
304Assert.Equal($"Hello, {Email}!", await client.GetStringAsync("/auth/hello"));
340var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password });
374Assert.Equal($"Hello, {Email}!", await client.GetStringAsync("/auth/hello"));
387var user = await userManager.FindByNameAsync(Email);
406var user = await userManager.FindByNameAsync(Email);
437await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password = "wrong" }),
440await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password = "wrong" }),
447await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }),
467await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password = "wrong" }),
474AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password }));
547Assert.Equal(Email, firstEmail.Address);
549await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }),
553AssertOk(await client.PostAsJsonAsync("/identity/resendConfirmationEmail", new { Email = Email }));
559Assert.Equal(Email, resentEmail.Address);
562AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password }));
581Assert.Equal(Email, email.Address);
670var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password });
708Assert.Equal($"Hello, {Email}!", await client.GetStringAsync("/auth/hello"));
715await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }),
718AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password, twoFactorCode }));
728var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password });
752await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }),
755var recoveryLoginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[0] });
769AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password }));
779var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password });
826var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password });
849await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }),
852AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[0] }));
854await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[0] }),
857var recoveryLoginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[1] });
881AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password, TwoFactorRecoveryCode = resetRecoveryCodes[0] }));
884await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[2] }),
895var loginResponse = await client.PostAsJsonAsync("/identity/login?useCookies=true", new { Email, Password });
915await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }),
919var sessionLoginResponse = await client.PostAsJsonAsync("/identity/login?useSessionCookies=true", new { Email, Password, twoFactorCode });
928var sessionLoginResponse2 = await client.PostAsJsonAsync("/identity/login?useCookies=true&useSessionCookies=true", new { Email, Password, twoFactorCode });
937var persistentLoginResponse = await client.PostAsJsonAsync("/identity/login?useCookies=true", new { Email, Password, twoFactorCode });
1039Assert.Equal(Email, infoResponse.GetProperty("email").GetString());
1044Assert.Equal(Email, GetSingleClaim(infoClaims, ClaimTypes.Name));
1045Assert.Equal(Email, GetSingleClaim(infoClaims, ClaimTypes.Email));
1048var newEmail = $"New-{Email}";
1057Assert.Equal(Email, infoPostContent.GetProperty("email").GetString());
1062Assert.Equal(Email, GetSingleClaim(infoPostClaims, ClaimTypes.Name));
1063Assert.Equal(Email, GetSingleClaim(infoPostClaims, ClaimTypes.Email));
1088Assert.Equal(Email, GetSingleClaim(claimsAfterEmailChange, ClaimTypes.Name));
1089Assert.Equal(Email, GetSingleClaim(claimsAfterEmailChange, ClaimTypes.Email));
1131var loginResponse = await client.PostAsJsonAsync("/identity/login?useCookies=true", new { Email, Password });
1135Assert.Equal(Email, infoResponse.GetProperty("email").GetString());
1139Assert.Equal(Email, GetSingleClaim(infoClaims, ClaimTypes.Name));
1140Assert.Equal(Email, GetSingleClaim(infoClaims, ClaimTypes.Email));
1143var newEmail = $"NewEmailPrefix-{Email}";
1151Assert.Equal(Email, infoPostContent.GetProperty("email").GetString());
1155Assert.Equal(Email, GetSingleClaim(infoPostClaims, ClaimTypes.Email));
1177Assert.Equal(Email, GetSingleClaim(claimsAfterEmailChange, ClaimTypes.Email));
1211await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }),
1213AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password = newPassword }));
1236var newEmail = $"New-{Email}";
1250Assert.Equal(Email, infoPostContent.GetProperty("email").GetString());
1257await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }),
1260AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password = newPassword }));
1382email ??= Email;
1390email ??= Email;
1407email ??= Email;