SQL, ASP .NET, VB .NET Authentication
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS Server Security > SQL, ASP .NET, VB .NET Authentication




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    SQL, ASP .NET, VB .NET Authentication  
Nikolay Petrov


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-19-04 12:50 PM

Is it possible to authenticate user using a SQL database, containing users
and passwords?

What I want to achive is:
I have as SQL database containig data for my app. This database also
contains usernames, passwords and rights which are specific for my app.
Also I have a middle tier WebService, which contains the business logic of
my app, and is responsible for connecting to SQL database.
The connection between SQL server and the WebService as made with hardcoded
user. I don't need to authenticate the Users with SQL server.
As a frontend I have a Windows Froms and ASP .NET applications.
The users should fill username/password boxes, then this information is to
be passed to the WebService, which checks the username and password in the
SQL database.
I want the WebService methods to be available only to users, which have
authenticated to the user database in SQL server.


Any ideas, sample code and documents of how to implement this would be
greatly appreciateble.
I use VB .NET

Thank you in advance!







[ Post a follow-up to this message ]



    Re: SQL, ASP .NET, VB .NET Authentication  
Rick Sawtell


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-19-04 10:51 PM


"Nikolay Petrov" <johntup2@mail.bg> wrote in message
news:%23PpIe%23dtEHA.220@TK2MSFTNGP15.phx.gbl...
> Is it possible to authenticate user using a SQL database, containing users
> and passwords?
>
> What I want to achive is:
> I have as SQL database containig data for my app. This database also
> contains usernames, passwords and rights which are specific for my app.
> Also I have a middle tier WebService, which contains the business logic of
> my app, and is responsible for connecting to SQL database.
> The connection between SQL server and the WebService as made with
hardcoded
> user. I don't need to authenticate the Users with SQL server.
> As a frontend I have a Windows Froms and ASP .NET applications.
> The users should fill username/password boxes, then this information is to
> be passed to the WebService, which checks the username and password in the
> SQL database.
> I want the WebService methods to be available only to users, which have
> authenticated to the user database in SQL server.
>
>
> Any ideas, sample code and documents of how to implement this would be
> greatly appreciateble.
> I use VB .NET
>
> Thank you in advance!
>
>


Given your scenario, a simple stored procedure should suffice..

This simply checks to see if the login exists in the db.  If it does, it
returns a 1, else it returns a 0


CREATE PROC dbo.usp_ValidateLogin
@LoginName varchar(50),
@Password varchar(50)
AS
SELECT LoginName, Password
FROM    tablename
WHERE LoginName = @LoginName
AND       Password = @Password

RETURN @@RowCount










[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:17 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register