Hello.
I have 2 sites. One is DotNetNuke, with it's own login/register control. And another one is built by me - ASP.NET 3.5
On DNN site, users are registering for a new account.
On my ASP.NET site, there is a simple login page with username and password.
When somebody has subscribed on DNN site and has it's user account there, I would like that he will able to login with his username and password on my ASP.NET site.
My two sites are sharing the same DataBase.
I checked the DataBase and found where the information about users is stored. There are 3 tables: Users(DNN table), aspnet_Users and aspnet_Membership.
I have created SQL query that retrieves those infos:
SELECT * FROM COMS_Users
INNER JOIN aspnet_Users ON
COMS_Users.Username = aspnet_Users.Username
INNER JOIN aspnet_Membership ON
aspnet_Users.UserId = aspnet_Membership.UserId
WHERE
COMS_Users.Username = @username
--AND
--aspnet_Membership.Password = @password
It works fine while getting user's infos only on UserName, but the password is encrypted, and I have no idea how to check it.
In the aspnet_Membership table there are 3 columns related to password: Password, Passwordformat and PasswordSalt.
Maybe based on the values inside, I can get the decrypted password, to verify it against the password entered by the user when he tries to login?
I already tried to use this code in ASP.NET site, on submit:
MembershipUser user = Membership.GetUser(login);
if (user != null)
{
string pwd = user.GetPassword();
}
But it doesn't work.
Do you have any suggestions?
Thanks in advance.