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...Performance and...Performance and...Create user+Encrypted Password and Salt+TripDecCreate user+Encrypted Password and Salt+TripDec
Previous
 
Next
New Post
8/2/2011 11:01 PM
 
Hi,

I have an application(out side dnn)  which creates users to dnn database using a sp (database stored procedure) as below.
But now i dont want to hard code, but going to pass the password/salt to application as a parameter.
and then encrypt inside the application.


Please let me know how can i get this done.

i cant use new DotNetNuke.Entities.Users.UserInfo(); create method as im out of dnn.

either in middle tier or db level solution would be helpful, Thanks in advance.

Cheers
vervednn

i.e.
---------------------------------------------------------------------------------------------------------------------
SET @ApplicationName = 'DotNetNuke'
DECLARE @Password nvarchar(128)
SET @Password = 'LLSXX8xW6+0EbrV4JBzL/YenA1D6BBfRnkYY7FtQvNGmmPOhVdPiAA=='
DECLARE @PasswordSalt nvarchar(128)
SET @PasswordSalt = 'P40ky5tExsx37nUIFnCWZQ=='
.
.......
EXEC dbo.aspnet_Membership_CreateUser @ApplicationName, @Username, @Password,
                @PasswordSalt, @email, @passwordquestion, @PasswordAnswer,
                @IsApproved, @CurrentTimeUtc, @CreateDate, @UniqueEmail,
                @PasswordFormat, @UserId
---------------------------------------------------------------------------------------------------------------------
 
New Post
8/6/2011 2:48 AM
 

I found it and working fine

In middle tier,

 System.Web.Security.MembershipUser newUser = System.Web.Security.Membership.CreateUser(email, strpassword, email)

 In Web.config     

<connectionStrings>
    <add name="MySqlConnection" connectionString="Data Source=xxxx-PC\SQLEXPRESS,1978;Initial Catalog=xxxx;Password=xxxxx;User ID=sa;MultipleActiveResultSets=True;" />
  </connectionStrings>
<system.web>    
    <machineKey validationKey="4064C4EE1751795629390787C3222886C6111911" decryptionKey="2065E0EECFECA8EE8CB888BF8C5E2E7F7C52C816FF916227" decryption="3DES" validation="SHA1" />

<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15">
      <providers>
        <clear />
        <add
          name="SqlProvider"
          type="System.Web.Security.SqlMembershipProvider"
          connectionStringName="MySqlConnection"
          applicationName="DotNetNuke"
          enablePasswordRetrieval="true"
          enablePasswordReset="false"
          requiresQuestionAndAnswer="false"
          requiresUniqueEmail="true"
          minRequiredPasswordLength="7"
          minRequiredNonalphanumericCharacters="0"
          passwordFormat="Encrypted" />       
      </providers>
    </membership>

And in SP,
INSERT INTO xxxxx_users (Username, FirstName, LastName, IsSuperUser, Email,DisplayName, UpdatePassword)    VALUES(@Username, @FName, @LName , 0, @Email, @AName  , 0)

SELECT @dnnuserid = userid FROM dnnverve_Users WHERE username = @Username

 INSERT INTO xxxxx_UserPortals (userId, PortalId, CreatedDate)   VALUES(@dnnuserid, @PortalId, GETDATE())

 INSERT INTO xxxxx_UserRoles (userId, roleId) SELECT @dnnuserid,   roleId  FROM dnnverve_RolesWHERE RoleName = 'Registered Users'

 Set @RetUserid = @dnnuserid

Return @RetUserid

 

 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Performance and...Performance and...Create user+Encrypted Password and Salt+TripDecCreate user+Encrypted Password and Salt+TripDec


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