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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...How Does DNN Hash/Encrypt Passwords?How Does DNN Hash/Encrypt Passwords?
Previous
 
Next
New Post
9/14/2012 5:36 PM
 
Some time ago MS defined web services that would allow an app to authenticate against the ASP .Net membership provider. Check them out.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
9/14/2012 5:45 PM
 

As others have said we simply wrap the asp.net membership provider. However I wanted to make a few points

  •  you say you're taking the hashed password - you cannot decrypt a hash, you can only decrypt if using encryption (hashing is a one way operation)
  • your code is definately wrong, as you need to use the machinekey decryptionkey (which is unique to each dotnetnuke install) - whilst the final value is base64 encoded that is just for storage, you need to first base64 decode and then you need to decrypt using a combination of that value, the salt and the decryption key. Whilst this is doable in code, it's much easier to simply call the sqlmembership provider methods - http://www.byteblocks.com/post/2011/0... is a good example
  • another way people work around this is to write a service request in DotNetNuke and pass the password to it (over SSL) and then run the relevant DotNetNuke code to login

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
9/14/2012 6:24 PM
 

Hi Cathal,

Thanks for the info.

  •  you say you're taking the hashed password - you cannot decrypt a hash, you can only decrypt if using encryption (hashing is a one way operation)

Yeah, I was using the term too loosely.  Also, I know DNN offers two methods of storage, one which uses hashing and one which uses encryption.  I am fairly sure these use the decryption method (2), but I wasn't 100% sure.  

  • your code is definately wrong, as you need to use the machinekey decryptionkey (which is unique to each dotnetnuke install) - whilst the final value is base64 encoded that is just for storage, you need to first base64 decode and then you need to decrypt using a combination of that value, the salt and the decryption key. Whilst this is doable in code, it's much easier to simply call the sqlmembership provider methods -http://www.byteblocks.com/post/2011/0... is a good example

Thanks for the link.  I read through that post, and it seems the actual decryption is delegated to the NetFourMembershipProvider.  However, after googling I was unable to find the source code or any documentation for that class, which I'd need to re-implement.  Do you know where I'd find that.

Also, that byteblocks article is showing how to decrypt the password, which is actually more than I need to do.  For me, it would suffice to be able to encrypt other strings using the same algorithm/salt/machine key that was used to encrypt the original password.  Then I could test if they match.  I don't know if the encryption direction is easier to implement than the decryption direction, but I thought I'd clarify in case it was.

Jonah

 
New Post
9/14/2012 6:39 PM
 

Hello,

I think Cathal's last point is really the key. Instead of trying to connect to the DB, why not just connect to the DNN system through the web. You can create a web service that Ruby can call and then just use the DNN API to validate the log in. Not only is that much much easier, but it's probably more robust as you move forward and potentially move to other systems.

Mike

 
New Post
9/14/2012 6:47 PM
 
Hi Mike,

Unfortunately, that's not a good option for us. We need the system to work independently of any .NET services. That is, the only dependency can be on the database itself. Creating a web service means that we've created a dependency on that service and all its infrastructure. If C# and .NET vanished from the face of the earth tomorrow, our solution should still work as long as that database is up and running.

So the only solution here, I think, is to get my hands dirty with the bowels of that NetFourMembershipProvider.

Thanks for the idea though.

Jonah
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...How Does DNN Hash/Encrypt Passwords?How Does DNN Hash/Encrypt Passwords?


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