|
1 | | -using Auth0.AuthenticationApi.Models; |
2 | | -using Auth0.Tests.Shared; |
3 | | -using FluentAssertions; |
4 | | -using System.Collections.Generic; |
| 1 | +using System.Collections.Generic; |
5 | 2 | using System.Linq; |
6 | 3 | using System.Net; |
7 | 4 | using System.Net.Http; |
8 | 5 | using System.Text; |
9 | 6 | using System.Threading; |
10 | 7 | using System.Threading.Tasks; |
11 | 8 | using System.Web; |
| 9 | + |
| 10 | +using FluentAssertions; |
12 | 11 | using Xunit; |
13 | 12 | using Moq; |
14 | 13 | using Moq.Protected; |
15 | 14 | using Newtonsoft.Json; |
16 | 15 |
|
| 16 | +using Auth0.AuthenticationApi.Models; |
| 17 | +using Auth0.Tests.Shared; |
| 18 | + |
17 | 19 | namespace Auth0.AuthenticationApi.IntegrationTests |
18 | 20 | { |
19 | 21 | public class PasswordlessTests : TestBase |
@@ -95,6 +97,29 @@ public async Task Can_launch_email_code_flow() |
95 | 97 | response.EmailVerified.Should().NotBeNull(); |
96 | 98 | } |
97 | 99 |
|
| 100 | + [SkippableFact] |
| 101 | + public async Task Can_launch_email_code_flow_for_SPA() |
| 102 | + { |
| 103 | + Skip.If(string.IsNullOrEmpty(email), "AUTH0_PASSWORDLESSDEMO_EMAIL not set"); |
| 104 | + |
| 105 | + var request = new PasswordlessEmailRequest |
| 106 | + { |
| 107 | + ClientId = "Qpnq5llXeWEn1o1iLYNQSr3zFI1YPg3K", |
| 108 | + Email = email, |
| 109 | + Type = PasswordlessEmailRequestType.Code, |
| 110 | + AuthenticationParameters = new Dictionary<string, object> |
| 111 | + { |
| 112 | + ["audience"] = "settings.Audience", |
| 113 | + ["scope"] = "openid profile email offline_access", |
| 114 | + } |
| 115 | + }; |
| 116 | + var response = await authenticationApiClient.StartPasswordlessEmailFlowAsync(request); |
| 117 | + response.Should().NotBeNull(); |
| 118 | + response.Email.Should().Be(request.Email); |
| 119 | + response.Id.Should().NotBeNullOrEmpty(); |
| 120 | + response.EmailVerified.Should().NotBeNull(); |
| 121 | + } |
| 122 | + |
98 | 123 | [SkippableFact] |
99 | 124 | public async Task Can_launch_sms_flow() |
100 | 125 | { |
|
0 commit comments