Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...How to authenticate DNN users on ASP.NET site?How to authenticate DNN users on ASP.NET site?
Previous
 
Next
New Post
12/2/2009 8:55 PM
 

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.

 

 
New Post
12/2/2009 9:43 PM
 

The password is encrypted by the machinekey value in the web.config; Not sure what method - i think that's specified in the web.config as well.

I'd use IWeb http://iweb.adefwebserver.com/ and create a web service to check the login vs the dnn one [such as for password changes] and then log them if valid. at the same time could pull any personal data [name/email] your app needs to operate. 

This has the advantage of keeping it to only 1 place a user needs to update their info. Though you could keep the username/password and if valid, store them in your app.

 
New Post
12/3/2009 11:43 AM
 

I visited the web site of the module, but I did not understand how it works. And there are also many additional extensions to download, will I need all of them?

If we take my simple case, when I have users on DNN site and the ASP.NET site where I have to authenticate these users. What will be the steps for me to make? How to link the 2 sites together?

Thank you

 
New Post
12/3/2009 3:23 PM
Accepted Answer 

There is another solution.

I have copied the machinekey and membership from DNN web.config to ASP.NET web.config and now it works like this:

 

            MembershipUser user = Membership.GetUser(login);
            if (user != null)
            {
                string pwd = user.GetPassword();
            }
            if(Membership.ValidateUser(login,password))
            {
                // DO SOMETHING...
            }
 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...How to authenticate DNN users on ASP.NET site?How to authenticate DNN users on ASP.NET site?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out