Friday, March 23, 2012

Prompt for user credentials for database

Hello friends,

In my web application I have saved my connection string into web.config file. Now I have to send this web application to the client in the form of web set up. The issue is that on the client side, user credentials for the database will be different. So can we do some setings that the web application whenever will run should ask for the server name, username & Password. If this can be done then the application can be run anywhere considering all compatibilities.

Please let me know how this can be done.

Thanks & Regards
Girish Nehte

Hi,

We also encounter same issue...we have done following things...

we have stored IP,Database Name,userid and password ( separated by "," ) in notepad file and saved it at some common location.

and in applications we are referring this information to access database...

and we are telling client to put these details in file...so user can not make any other changes in web.config by mistake.

|||

Hi there,

Maybe I didn't understand well what's your problem, but it seems quite simple to me.

You only have one connection string (or user of the database). Then you have, for example, a table with many usernames/passwords you like.

When your client uses the applicaction, you ask for credentials right? Then you use your connection string, to check if its credentials match with any stored on the passwords table! If so you allow him to continue. If not, you don't allow the client to continue.

Hope it helped out :) And its safer than having it written on a text file!

gonzzas

No comments:

Post a Comment