I am developing an ASP.NET web application and I use the following connection string to authenticate:
System.Data.SqlClient.SqlConnection(UserConnectionString())
The issue is that if I have for example the password : “pass123″ and I enter ” pass123″ or “pass123 “, the uses authenticates, and will be logged in. The password is trimmed, any suggestions to block this?
Enclose the password in the connection string in either single- or double- quotations marks, as suggested here to preserve leading or trailing spaces.