/    Sign up×
Community /Pin to ProfileBookmark

Login using SQL id

I ave some pages on my site which draw info from our SQL server. I have configured a login script which runs off a password.txt file where i have the user names and password. I would like to use the ids created for these users in sql and authenticate them using the pwd given by then in sql. this way i need not maintain a txt file.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@AdamGundryApr 25.2003 — If I understand you right, you need to create a password field in your table (make it a large VARCHAR), then you can test for a valid login using the following:

select * from table where userid='whatever' and password=MD5('whatever')

Note this is using MD5 encryption on the password field, so when you initally store the password you need to use MD5 as well.

The exact syntax depends on the language you are using to write the pages (e.g. PHP, ASP) and the SQL server being used (e.g. MySQL, Oracle).

Adam
Copy linkTweet thisAlerts:
@achatauthorApr 25.2003 — No, I already have some users registered in MSSQL and they have passwords stored in system tables. I would like to use these.
Copy linkTweet thisAlerts:
@AdamGundryApr 25.2003 — Oh, I see. You should still be able to use a select statement on the tables, like the one above (you can in MySql, I'm afraid I'm not familiar with MSSQL). Again, there should be a function to put a password into the table, e.g. in MySql it is PASSWORD().

Adam
×

Success!

Help @achat spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...