Beispiel #1
0
        public async Task Can_launch_email_link_flow_with_auth_parameters()
        {
            // Arrange
            using (var authenticationApiClient = new AuthenticationApiClient(GetVariable("AUTH0_AUTHENTICATION_API_URL")))
            {
                // Act
                var request = new PasswordlessEmailRequest
                {
                    ClientId = GetVariable("AUTH0_CLIENT_ID"),
                    Email    = "your email",
                    Type     = PasswordlessEmailRequestType.Link,
                    AuthenticationParameters = new Dictionary <string, object>()
                    {
                        { "response_type", "code" },
                        { "scope", "openid" },
                        { "nonce", "mynonce" },
                        { "redirect_uri", "http://localhost:5000/signin-auth0" }
                    }
                };
                var response = await authenticationApiClient.StartPasswordlessEmailFlowAsync(request);

                response.Should().NotBeNull();
                response.Email.Should().Be(request.Email);
            }
        }
Beispiel #2
0
        public async Task Can_launch_email_link_flow()
        {
            Skip.If(string.IsNullOrEmpty(email), "AUTH0_PASSWORDLESSDEMO_EMAIL not set");

            var request = new PasswordlessEmailRequest
            {
                ClientId     = GetVariable("AUTH0_CLIENT_ID"),
                ClientSecret = GetVariable("AUTH0_CLIENT_SECRET"),
                Email        = email,
                Type         = PasswordlessEmailRequestType.Link
            };

            var response = await authenticationApiClient.StartPasswordlessEmailFlowAsync(request);

            response.Should().NotBeNull();
            response.Email.Should().Be(request.Email);
            response.Id.Should().NotBeNullOrEmpty();
            response.EmailVerified.Should().NotBeNull();
        }
Beispiel #3
0
        public async Task Can_launch_email_code_flow()
        {
            // Arrange
            var authenticationApiClient = new AuthenticationApiClient(new Uri(GetVariable("AUTH0_AUTHENTICATION_API_URL")));

            // Act
            var request = new PasswordlessEmailRequest
            {
                ClientId = GetVariable("AUTH0_CLIENT_ID"),
                Email = "your email",
                Type = PasswordlessEmailRequestType.Code
            };
            var response = await authenticationApiClient.StartPasswordlessEmailFlowAsync(request);
            response.Should().NotBeNull();
            response.Email.Should().Be(request.Email);
        }
        public async Task Can_launch_email_code_flow()
        {
            // Arrange
            var authenticationApiClient = new AuthenticationApiClient(new Uri(GetVariable("AUTH0_AUTHENTICATION_API_URL")));

            // Act
            var request = new PasswordlessEmailRequest
            {
                ClientId = GetVariable("AUTH0_CLIENT_ID"),
                Email    = "your email",
                Type     = PasswordlessEmailRequestType.Code
            };
            var response = await authenticationApiClient.StartPasswordlessEmailFlowAsync(request);

            response.Should().NotBeNull();
            response.Email.Should().Be(request.Email);
        }