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...Getting a userGetting a user's Password
Previous
 
Next
New Post
3/5/2007 10:08 AM
 
Hi,

I am trying to expose the user's password in a template for my UserProfile module. I tried
userInfo.Membership.Password
and this seems to be null?

I checked the SendPassword stuff in the core and it does:

                    ' special case for encrypted passwords
                    If (Prefix & strPropertyName = "Membership:Password") And Convert.ToString(Common.Globals.HostSettings("EncryptionKey")) <> "" Then
                        Dim objSecurity As New PortalSecurity
                        strPropertyValue = objSecurity.Decrypt(Common.Globals.HostSettings("EncryptionKey").ToString, strPropertyValue)
                    End If

I assume strPropertyValue is the encrypted password, but it seems to be blank if I use userInfo.Membership.Password - how should I retrieve it? (I can run it through the same decryption but I can't seem to even get the decrypted value...)

Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
3/5/2007 10:46 AM
 

Hi Rodney,

That Common.Globals.HostSettings("EncryptionKey") stuff is very old DNN 2.x (before aspnet MemberRole ).

It won't work to get a password from the current membership profiles.

You could use:  UserController.GetPassword

Which is what is used in the SendPassword routine, but even with that you are going to have problems if Hashed passwords are used.

Also consider that RequiresQuestionAndAnswer may be set to true which does not work in the current version of DNN.

You probably know, but it is not a good idea to expose passwords at the UI.  They should always be reset by someone with authority, not viewed.

 


DotNetNuke Modules from Snapsis.com
 
New Post
3/5/2007 10:10 PM
 
 

'Dim mUser As DotNetNuke.Entities.Users.UserInfo = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo

'Dim userpass as strring

'userpass = DotNetNuke.Entities.Users.UserController.GetPassword(mUser, mUser.Username)

 
New Post
3/6/2007 3:56 AM
 
Thanks for the replies. John - this is purely a token in a template - I've put a warning with it - but it's up to them if they do want to expose the password in the template.

I don't seem to have the same overload - I have:
UserController.GetPassword(ref UserInfo user, string PasswordAnswer
and when I pass in
UserController.GetPassword(ref userInfo, userInfo.Membership.PasswordAnswer)

it errors (userInfo is the current user and is populated) - I have also tried
UserController.GetPassword(ref userInfo, "")

but no luck. I am doing this in a normal class, not a UserControl that has inherited from PortalModuleBase so I'll have a look at what the UserController class is failing on...

Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
3/6/2007 8:32 PM
 

To use the method I posted, you need to not be using question and answer for asp.net membership.

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Getting a userGetting a user's Password


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