Solved

SQL Server Express Triggers to Compare hashed passwords before updating user passwords

Posted on 2014-11-25
4
113 Views
Last Modified: 2015-01-12
I recently asked a question where i need to develop a way to compare the last 5 passwords for a user before they update their password in a SQL database prior to the password being changed.  I asked this using the .Net engine http://www.experts-exchange.com/Database/MS-SQL-Server/Q_28553621.html and seem to not be making it very far.

It made me think that this has to be a common issue that maybe i'm not looking at it the right way.  Is there a way to use SQL Server Triggers or procedures to compare the hashed passwords.   For example, I have a PasswordHistory table in the database that stores the history of the hashed password which are copies of the hashed password in the aspnet_Membership table for the users.  I imagine that you could create a temporary table that the password that is suggested is first inserted and then if it is a comparison reject the update of the membership table.  

I have no real idea how to write SQL Triggers or Procedures so I am reaching out to you all to see if there is an answer.  I've been working on this issue for 6 months and intensely the last three weeks.  Thank you in advance.
0
Comment
Question by:atljarman
  • 2
  • 2
4 Comments
 
LVL 46

Accepted Solution

by:
Vitor Montalvão earned 500 total points
ID: 40466483
Why do you need to reinvent the wheel? Just enforce the password policy in the SQL Server for the logins you want
SQLPasswordPolicy.PNGand then in the Local Security Policy (Start > Control Panel > Administrative Tools > Local Security Policy) adjust the policies as you need:
LocalPasswordPolicy.PNG
0
 

Author Comment

by:atljarman
ID: 40466503
Ok.  So the user names and passwords are stored in tables that are accessed and updated by .net.  I think that is different than sql server logon user and passwords.  I think your recpmmendation is kob th latter, correct?  Thank you for trying to help.
0
 
LVL 46

Expert Comment

by:Vitor Montalvão
ID: 40466509
Aren't SQL Server logins?
0
 

Author Comment

by:atljarman
ID: 40545716
These are ASP .Net Membership SQL Server database passwords - This was solved on another question but will award points even though it was answering a different question.   I don't think I was asking the right question.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now