MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

any option to import a list of users ?  (Mono Support )

Viewed 46939 time(s), 24 post(s) 7/25/2013 6:58:50 PMby super
super

super

7/25/2013 6:58:51 PM
I have a list of users from other site that I want to import in monox.

I do not want to do that from the database and looking for a import feature, any better way to do it in admin side of monox ?

Also, my list of customer for other site have password that is hashed in my database, how to transfer that ?
This content has not been rated yet. 
6018 Reputation 709 Total posts
super

super

7/25/2013 8:58:33 PM
Also, if there is no option, how to transfer users from database as my other website users password is being saved as hashed and there is a field called "PasswordSalt"

But monox required two fields "PasswordSalt" and "Password"

What should I do with the field "Password" as it is the plain text not encrypted password and I can't decrypt hashed passwords for 1000 users from other website database ?

(Just curious, why monox is using this plain text password field any way as it is a bad practice to save the user's password without any encryption, it is so easy to get the password for any user if someone hack into the database. These days all sites save encrypted password and  the user supplies their password, it gets hashed with the salt and then the hash is compared to the one in the database.  If they match, it's the right password and you can log in.)
This content has not been rated yet. 
6018 Reputation 709 Total posts
khorvat

khorvat

7/26/2013 8:32:46 AM
Hi,

Import is possible but you will have to do it manually, so

I do not want to do that from the database and looking for a import feature, any better way to do it in admin side of monox ?
Import UI is missing as most imports that we do and our customers are doing are pretty complex and require additional non-general processing.

Also, if there is no option, how to transfer users from database as my other website users password is being saved as hashed and there is a field called "PasswordSalt"
But monox required two fields "PasswordSalt" and "Password"
What should I do with the field "Password" as it is the plain text not encrypted password and I can't decrypt hashed passwords for 1000 users from other website database ?
In order to perform an import you do need a Password, PasswordSalt fields in your database which will be transferred to corresponding fields in MonoX database. As you are using hashed passwords you will need to change the PasswordFormat in MonoX database to "1" as this is hashed format. BTW hash algorithm is one-way algorithm so you can't decrypt at all.

(Just curious, why monox is using this plain text password field any way as it is a bad practice to save the user's password without any encryption, it is so easy to get the password for any user if someone hack into the database. These days all sites save encrypted password and  the user supplies their password, it gets hashed with the salt and then the hash is compared to the one in the database.  If they match, it's the right password and you can log in.)
MonoX has a plain password format set by default because it's much easier to build a custom solution that way, when you can check the test or demo user's password. We always recommend that password format is changed to hash format for production environments. This is standard ASP.NET membership setting that can be changes before you push your web site to production.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
pajo

pajo

7/26/2013 8:40:48 AM
MonoX is using standard asp .net membership provider as it's base and it does allow you to change and configure how you're storing user password, out of box you can choose 3 types clear, hashed, and encrypted. First and last are retrievable, while hashed password is not. Password is always stored under password field, salt is used only when generating hash or encrypting password and doesn't change during lifetime of a user in the system.
This content has not been rated yet. 
629 Reputation 83 Total posts
super

super

7/26/2013 12:10:19 PM
Khorvat,

1) Then, how I can transfer the password since the source database of my other site is only giving me 1 field which is "PasswordSalt" ?

Should I transfer all the data from "PasswordSalt" of other site database to monox "PasswordSalt" field and keep "Password" field empty and use format as 1 ?

2) I manually added a user account from other site to one row of monox user membership tables. I copied the passwordSalt key from other website's database and pasted in monox membership table row and use password format as 1 and kept the password field empty.

still I am not able to login ? why ?

(Fyi...I know the password of this user that I am trying as it is my account from other website)


3) How to set the default format to hash in monox ? right now I am doing directly in database but if anyone register on my monox based site, how to make sure his/her password is saved as hashed ? any setting in webconfig or in code ?

This will do the job ? passwordFormat="Hashed" in webConfig ?
This content has not been rated yet. 
6018 Reputation 709 Total posts
khorvat

khorvat

7/26/2013 12:05:52 PM
Hi Super,

As Vlatko explained PasswordSalt is only used to hash the password entered by the user so you can compare already hashed password and the one entered by the user, so you have to have a password stored in your database in a hashed format.
1) Then, how I can transfer the password since the source database of my other site is only giving me 1 field which is "PasswordSalt" ?
 
Should I transfer all the data from "PasswordSalt" of other site database to monox "PasswordSalt" field and keep "Password" field empty and use format as 1 ?
MonoX is using standard ASP.NET membership so please follow that structure and add required data to Aspnet_Users table, and if needed add that user to appropriate role in Aspnet_UserInRoles table.
2) I manually added a user account from other site to one row of monox user membership tables. I copied the passwordSalt key from other website's database and pasted in monox membership table row and use password format as 1 and kept the password field empty.
 
still I am not able to login ? why ?

Ok, np you just need a hashed password from your older database.
(Fyi...I know the password of this user that I am trying as it is my account from other website)
Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
super

super

7/26/2013 12:19:16 PM
Khorvat, I have added the row manually for user in membership table, user table and userInRole.

Added roleID for "Users" and mapped with UserID in "UserInRole" ebaf7b92-bb12-40c3-b3e4-fd40b9932e3e

But still not able to login with this new added account of user, why ?

Update: I even assign this newsly added record 3 roles, User, Publisher and Administrator in the UsersInRole table but still not able to login ?

FYI...I have set the format for Password in table as "1" and the password field is empty and PasswordSalt is there as I copied that salt key from other database table to monox table.
This content has not been rated yet. 
6018 Reputation 709 Total posts
khorvat

khorvat

7/26/2013 12:18:32 PM
Did you put in the hashed password ?
As Vlatko explained PasswordSalt is only used to hash the password entered by the user so you can compare already hashed password and the one entered by the user, so you have to have a password stored in your database in a hashed format.
Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
super

super

7/26/2013 1:06:21 PM
Yes, please see the screenshot, 2nd row

UPDATE: Screenshot was removed due to security reasons.
This content has not been rated yet. 
6018 Reputation 709 Total posts
super

super

7/26/2013 1:14:08 PM
Also, this is a screenshot of data from other table as you can see the field...

In the above exmaple, I copied the "SaltKey" field to "PasswordSalt" field in monox but still not working ?

UPDATE: Screenshot was removed due to security reasons.

This content has not been rated yet. 
6018 Reputation 709 Total posts
1 2 3