public void loginUsertoTidalStreamingServiceTest()
        {
            String username = "******";
            String password = "******";

            OpenTidlSession loginSessionResult = testInfrastructureClass.loginUsertoTidalStreamingService(openTidlClient, username, password);

            String FirstName = loginSessionResult.GetUser().Result.FirstName;

            FirstName.Should().Equals("Omar");
            String LastName = loginSessionResult.GetUser().Result.LastName;

            LastName.Should().Equals("Alkhateeb");
            String email = loginSessionResult.GetUser().Result.Email;

            email.Should().Equals("*****@*****.**");
        }
Exemplo n.º 2
0
        public override async Task <AuthenticationResponse> LoginAsync(string username, string password)
        {
            try
            {
                session = await client.LoginWithUsername(username, password);
            }
            catch (OpenTidlException)
            {
                return(null);
            }
            var user = await session.GetUser();

            return(new AuthenticationResponse
            {
                Token = session.SessionId,
                UserIdentity = null,
                UserName = String.IsNullOrEmpty(user.FirstName) && String.IsNullOrEmpty(user.LastName) ?
                           user.Email : $"{user.FirstName} {user.LastName} ({user.Email})"
            });
        }