Re: Authenticating domain users

From: D0tN3t C0d3r (d0tn3tc0d3r_at_yahoo.com)
Date: 03/01/05


Date: Tue, 01 Mar 2005 13:00:04 -0800

Hi Yaron,

What kind of application is this? Is it a Web Application or a Windows
Forms Application? The reason being, there are different methods for
network authentication based upon the model used. I will provide links
to both.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secmod/html/secmod16.asp
(Using Forms Authentication)

http://www.codeproject.com/csharp/getusername.asp (Windows Forms)

http://www.dnzone.com/ShowDetail.asp?NewsId=504

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconaspnetauthentication.asp

For your second question, what you need to do is in your connection
string for the SqlConnection object, you need something along these
lines: "server=(local);database=Northwind;Trusted_Connection=yes". You
can also dynamically build the connection string using:
"server=(local);database=Northwind;UID=<user
name>;PWD=<pass>;Trusted_Connection=yes;"

HTH,
~d

Yaron wrote:
> Hi,
>
> I am writing a program that will require a user to log in using their domain
> account which will then take the information to a SQL Server database stored
> on the server and try to log in using that information.
>
> Several questions:
>
> 1) What class should I use once I have the username / password to
> authenticate the account on the domain?
> 2) Is there any way for me to use Windows' authentication dialog? This is
> the dialog that always comes up when you try to access something that you
> need to login to. IE uses it, as well as Windows Explorer. I'd much rather
> use this dialog somehow than create one of my own.
> 3) Slightly unrelated question... Lets say the user authenticated correctly
> against the domain, and now I want to access the database. I currently have
> it set so that I have database roles assigned to user types on the domain.
> So, when I login to the database using SqlConnection, should the username and
> password be set to the the user's domain username and password?
>
> Thanks for all help!
>
> Yaron



Relevant Pages

  • Re: Windows Authentification against a list of users
    ... > One thing you might do would be to validate against a group in the domain ... > as your list of allowed users instead of your database though. ... > using Forms authentication instead of Windows authentication and creating ... That would allow you to combine Windows ...
    (microsoft.public.dotnet.security)
  • Re: Change in ASP.Net authentication between Win2000 and Win2003
    ... > is turning on/off Kerberos is occuring. ... It control how IE deals with "Authentication: ... when you put IIS6 in a domain and have "Integrated Windows Authentication" ...
    (microsoft.public.windows.server.security)
  • Re: Change in ASP.Net authentication between Win2000 and Win2003
    ... > is turning on/off Kerberos is occuring. ... It control how IE deals with "Authentication: ... when you put IIS6 in a domain and have "Integrated Windows Authentication" ...
    (microsoft.public.inetserver.iis.security)
  • Re: Need help configuring Wireless Connection profile
    ... and I can only use the intel OR windows utility, not both at the same time. ... Windows authentication for all users,4129,LRG\ryanv,4149,Wireless WPA2 ... SMALL BUSINESS SERVER: ... STEP #1 Install Certificate Services ...
    (microsoft.public.windowsxp.general)
  • Re: Sql Server Login
    ... firstly I was under the impression SQL authenticaiton will be better ... But now I know windows authentication is recommended. ... Now my application is ready and talking to this database in MSDE. ...
    (microsoft.public.sqlserver.msde)