Product Support Forums

Everything working but password sync
Last Post 06 Jan 2010 03:50 PM by melaniee. 10 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
melaniee
New Member
New Member
Posts:7


--
31 Dec 2009 04:48 PM  
I would like to be able to have the user update their password on our DNN site and have it written to their employee record on our sql2000 database. The userid is getting written to our table just fine after the first login. Login works fine and roles are assigned perfectly and users are getting e-mails. When a user changes their password, it all seems fine and they get e-mails etc but the next time they log in the password is still the old one (and confirmed in our sql database) - so I thought it didn't 'take' the first time - however when you try to update the password again it doesn't work at all - I get an error stating there was an error setting the password. The password has not been changed.

My stored procedure is very simple because I only want users to be able to change passwords in our database:

CREATE PROCEDURE dbo.ICG_External_SyncUserInfo
@DnnUserId INT,
@Username VARCHAR(255),
@FirstName VARCHAR(255),
@LastName VARCHAR(255),
@Email VARCHAR(255),
@Password VARCHAR(255)
AS
UPDATE employee_data
SET
sys_Password = @Password
WHERE web_userid = @dnnuserid
GO

And I can run this at SQL with the correct dnnuserid and it executes fine.

Otherwise your module is very nice but I would like to be able to do this option.
melaniee
New Member
New Member
Posts:7


--
31 Dec 2009 05:01 PM  
One more thing - when the user goes back and asks for forgotten password they get the new password - only that isn't what is in our external database - so they do now now match.
Mitchel Sellers
Site Moderator
Basic Member
Basic Member
Posts:256


--
02 Jan 2010 05:13 PM  
Hello,

Sorry for the delayed response on this.

What version of the provider are you using? The way that this should work is as follows.

The next time the user goes to login, we will sync out the password update to your system, THEN we will try to log the user in.

Is the DNNId properly set in your system?
-Mitchel Sellers, Microsoft C# MVP, MCITP
CEO
IowaComputerGurus Inc!

Visit my blog for helpful technical articles

For recommended products and services view the links to the right.
melaniee
New Member
New Member
Posts:7


--
04 Jan 2010 10:07 AM  
The ID is properly being writting back to my database. I'm not sure how to tell the version? My DNN is 4.9.5. The download I have for this module is 16487_0_ICG.Modules.CustomAuthentication_030001_Install.

melaniee
New Member
New Member
Posts:7


--
05 Jan 2010 12:05 PM  
Just looking for any more information or perhaps something I can do to trouble-shoot. I even renamed my column in my SQL db to DNNUserId and tried syncing the password - still does not work.

Please let me know what I might do to get this working - or I will probably just need to un-install and look for something else.

Thanks you
Mitchel Sellers
Site Moderator
Basic Member
Basic Member
Posts:256


--
05 Jan 2010 06:51 PM  
The only thing I can think of right now, would be to use SQL Profiler to see what the values are that are being written back to your database?

If we see the updates, lets validate the stored procedure call. We are using built in DNN methods to get the password back.
-Mitchel Sellers, Microsoft C# MVP, MCITP
CEO
IowaComputerGurus Inc!

Visit my blog for helpful technical articles

For recommended products and services view the links to the right.
melaniee
New Member
New Member
Posts:7


--
06 Jan 2010 11:44 AM  
OK - I think I see where the problem lies. I was testing on myself - if I assigned myself to the administrator role, the password would not sync back to the external database. If I was assigned to the Registered User role then it does sync back. This may be by design? At any rate it is fine. I will not be adding anyone else to the administrator role. I will test to if I set up new roles and add people to them if it will still sync.

Thank you for the help.
Mitchel Sellers
Site Moderator
Basic Member
Basic Member
Posts:256


--
06 Jan 2010 12:24 PM  
Yes, this is 100% by design.

As per the documentation, all users with the Administrator or Host roles will NEVER go through the external database processes. This is to prevent a lockout situation.
-Mitchel Sellers, Microsoft C# MVP, MCITP
CEO
IowaComputerGurus Inc!

Visit my blog for helpful technical articles

For recommended products and services view the links to the right.
melaniee
New Member
New Member
Posts:7


--
06 Jan 2010 12:25 PM  
OK I have one more question and I promise to leave you alone. I would like to also sync my external DB to DNN if the password is changed. I have an insert/update trigger on my employee table that I can put some code, but I need to be sure of what table and column I need to update? Is it possible to do this?
Mitchel Sellers
Site Moderator
Basic Member
Basic Member
Posts:256


--
06 Jan 2010 12:38 PM  
If you want to update DNN from the external database, you have to turn off the DNN syncing out to the external database. There can only be one source of record for user information.

You cannot write passwords directly to DNN, they are encrypted by default, and must run through some .NET code to make that happen.
-Mitchel Sellers, Microsoft C# MVP, MCITP
CEO
IowaComputerGurus Inc!

Visit my blog for helpful technical articles

For recommended products and services view the links to the right.
melaniee
New Member
New Member
Posts:7


--
06 Jan 2010 03:50 PM  
Thanks for the additional info. I had read the documentation, but thought it only pertained to the DNN Administrator and Host accounts - didn't think about other users having the administrator role assigned to them.

I think I'm going to leave the syncing as it is for now. I will just remove the option to change passwords on our external DB and instruct that they need to change from our intranet (dnn).

Thanks again for the information and module -
You are not authorized to post a reply.

Active Forums 4.0