Re: SQL2K and .NET
From: Etienne Charland (mystery@golden.net)
Date: 03/13/03
- Previous message: Shahin Kohan: "username for a process"
- In reply to: Shawn: "SQL2K and .NET"
- Next in thread: Alek Davis: "Re: SQL2K and .NET"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "Etienne Charland" <mystery@golden.net> Date: Thu, 13 Mar 2003 15:35:12 -0500
There are several good ways to implement authentication.
1) You can use Windows Integrated Security, and use system accounts
2) You can implement custom authentication...
Private Sub Login_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Login.Click
If AuthenticateUser(txtUser.Text, txtPass.Text) Then
FormsAuthentication.RedirectFromLoginPage(txtUser.Text, False)
Else
lblErreur.Visible = True
End If
End Sub
(add the AuthenticateUser function, wich will check in a database table to
see if login is valid)
You'll need something like this in the configuration file. They will be
redirected to the login.aspx page if they're not authenticated.
<authentication mode="Forms">
<forms loginUrl="login.aspx" name=".APPLOGIN" protection="All" />
</authentication>
There are other methods, but I think those are 2 good ones. In either way,
you can specify many options in the configuration file, including rights
that apply to each page or folder. You can tell what users have access to
what files, and what actions they can do on it.
In MSDN, read those pages from the index:
"RedirectFromLoginPage method"
"authorization element"
Hope this helps.
Etienne
"Shawn" <shawntrevellick@hotmail.com> wrote in message
news:093f01c2e914$ac040ec0$3001280a@phx.gbl...
> Hey all,
>
> I am relatively new to the .NET environment. I am
> creating an ASP web app that connects to SQL2K. I am
> having a little trouble with the connection string. I
> can connect to my db no problem. My issue is that people
> can log onto my website and add themselves as a user.
> How do I change the connection string to use their login
> and password? Is there something I am missing? I am
> using the sp_addlogin to add them as a user in the
> database but I could have several hundred people logged
> in at one time. I am really confused, help
>
> Shawn
- Previous message: Shahin Kohan: "username for a process"
- In reply to: Shawn: "SQL2K and .NET"
- Next in thread: Alek Davis: "Re: SQL2K and .NET"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|