Link to home
Start Free TrialLog in
Avatar of Ondrejovic
OndrejovicFlag for Slovakia

asked on

Using database users for authorization and authentication in dotnet

I have MS SQL database with database-users and I would like to create intrantet ASP.NET front-end.

Is it somehow possible to use those db-users to authenticate in ASP.NET?
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

User Authentication & Role Management in ASP.NET 2.0 using Sql Server 2005: Part I
http://www.c-sharpcorner.com/UploadFile/praveenalwar/PraveenAlwar07202006064726AM/PraveenAlwar.aspx
Avatar of Ondrejovic

ASKER

If I understand both suggestions, those are generic answers for "I need some formular for login/password".
My problem is a little more specific:

How to implement custom memebership provider to use db-users (not users defined in some table within the database) ?
Your original question was a very generic one, so I couldn't provide you a specific answer :)

Below you can find several articles about implementing  custom membership  ...

How to: Implement a Custom Membership User
http://msdn.microsoft.com/en-us/library/ms366730.aspx

Writing a Custom Membership Provider for the Login Control in ASP.NET 2.0
http://www.codeguru.com/csharp/.net/net_security/article.php/c19415/Writing-a-Custom-Membership-Provider-for-the-Login-Control-in-ASPNET-20.htm

Write custom membership provider for ASP.Net
http://www.devx.com/asp/Article/29256

Video: [How Do I:] Create a Custom Membership Provider?
http://www.asp.net/web-forms/videos/how-do-i/how-do-i-create-a-custom-membership-provider
all these examplles use users stored in table(s) within the database, not database-users

what I would like is to use users defined in database (SQL Server Management studio -> Security -> Logins)
ASKER CERTIFIED SOLUTION
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This negative answer from year 2005 improved my google search.

This is similar discussion: http://www.xtremedotnettalk.com/showthread.php?t=97038
with result: use dynamic connection string as http://www.4guysfromrolla.com/articles/103002-1.aspx

Maybe it's acceptable solution. I'm waiting for real implementation (or for better solution).
I've requested that this question be closed as follows:

Accepted answer: 500 points for Dhaest's comment #37859196

for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
The real implementation ended as a manual-work.
- Credentials are stored in the sesson.
- In web.config there is only template of connection string.
- Real connection string is created by adding the credentials to the template.
- This is then supplied to data-layer.

It's working but not nice.
Thanks for Dhaest help, but #37859196  is not solution of this question.
I don't know how to close this topic correctly .
#37878226 is almost a solution.
I think it's ok to close this topic. (My solution is inspired by Dhaest  comments). I would prefer not to delete this question, because someone else might have the same problem and will need the inspiration too.