How do I get security login info from a database? ASP.NET

S

Steve Kershaw

Hello,

This is an interesting question....

In the Web.Config file one can set up users login by including the
following code:

<authentication mode="Forms">
<forms defaultUrl="Default.aspx" loginUrl="Login.aspx" path="/"
enableCrossAppRedirects="false" protection="All" name="MyCookie"
timeout="30" slidingExpiration="false" >
<credentials passwordFormat="Clear">
<user name="Admin" password="admin"/>
<user name="bean" password="abean"/>
</credentials>
</forms>
</authentication>

<authorization>
<deny users="?"/>
</authorization>

However, there is a way to point to a database to retrieve the userid
and password. How can I do this? I have looked in the documentation and
I cant find anything.

Thanks for your help.

Steve
 
M

Marina Levit [MVP]

Well, to do anything to a database, you need to log into it first. So it's a
catch 22.

You should be able to get a list of usernames from the database server, but
I doubt you could get the passwords - that would be a major security breach.
I would expect you could change a password for a user, but not retrieve it.
 
S

Steve Kershaw

You mean all of the userid's and passwords have to be stored in the
Web.Config flat file? There has got to be a way.

Thanks

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top