public static async Task <DMIUser> CreateDisabledUser()
        {
            IdentityProviderUser identityProvideruser = new IdentityProviderUser();
            NewUser newuser     = NewUser.GenerateRandomUser();
            var     userCreated = await identityProvideruser.Create(newuser);

            DMIUser user = new DMIUser(userCreated, Config.Environment.ClientId);

            user.password = newuser.password;

            InsertUserIntoCTNReportDatabase(user);
            user.DisableUser();

            return(user);
        }
        public static async Task <DMIUser> Create(string clientId)
        {
            NewUser newuser = NewUser.GenerateRandomUser();

            IdentityProviderUser identityProvideruser = new IdentityProviderUser();
            var userCreated = await identityProvideruser.Create(newuser);

            DMIUser user = new DMIUser(userCreated, clientId);

            user.password = newuser.password;

            InsertUserIntoCTNReportDatabase(user);
            Log.MetaData($"User created with username {user.username}");
            Log.MetaData($"              and password {user.password}");
            return(user);
        }
Exemple #3
0
        public static async Task <DMIUser> Create(NewUser newuser, string clientId)
        {
            DMIUser user = new DMIUser(clientId);
            IdentityProviderUser identityProvideruser = new IdentityProviderUser();

            var userCreated = await identityProvideruser.Create(newuser);

            user.username  = userCreated.username;
            user.firstname = userCreated.firstName;
            user.lastname  = userCreated.lastName;
            user.email     = userCreated.email;
            user.userId    = userCreated.id;

            InsertUserIntoCTNReportDatabase(user);

            return(user);
        }
        public static async Task <DMIUser> Create(NewUser newuser, string clientId)
        {
            try
            {
                IdentityProviderUser identityProvideruser = new IdentityProviderUser();
                var userCreated = await identityProvideruser.Create(newuser);

                DMIUser user = new DMIUser(userCreated, clientId);
                user.password = newuser.password;

                Console.WriteLine("dmiuser username is:  " + user.username);
                InsertUserIntoCTNReportDatabase(user);

                return(user);
            }
            catch (Exception)
            {
                throw Log.Exception("Unable to create dmi user login details");
            }
        }