473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to authenticate user and make access to sql database

Hi there ..

I have the following scenario.

I have a Webservice which is running under Win2003/IIS6 with .Net1.1 The
Service itselfs connects to a database which is a SQL 2000 on a Server
in the same domain.

Client is a Windows Form Client (no ASP.NET yet) which connects to the
WebService. Before WebService I would make a SQL Server connection with
the Username & Password specified in the Client and then in the stored
procedure I could get the actual User and limit my sql statements to
this user ...

for example

select jobname from jobs where owner = current_user

It didnt use Windows Authentication so I could change the credentials in
the client without logging into Windows with a different user ...

I though of a similiar approach for the Webservice ...

But here not the client is creating the SQL Server connection. So I
would have to pass the Username & password each time when accessing a
Webservice function?

If I use authentication in IIS (with removing the anonymous access) I
must have the user creating in the Windows Domain, right? But I only
want them in the SQL Server.

How would you solve this? Client which access Webservice which then
access the SQL Database.
--
mfg
Marc Eggenberger
Nov 23 '05 #1
1 2382
Hi Marc,

It sounds like you need to do the same thing you used to do from your rich
client applications ... that is pass the credentials to the web service
rather than trying to pick them up from IIS. If you enable SQL
authentication (or both) on your SQL server, then you could take the
credentials passed by the caller, use these to connect to the database, and
then that connection would have a "current user" that meets your
expectations.

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
From: Marc Eggenberger <ma**************@remove.itc.alstom.com>
Newsgroups: microsoft.public.dotnet.framework.webservices
Subject: How to authenticate user and make access to sql database
Date: Tue, 7 Dec 2004 14:02:19 +0100
Organization: *
Lines: 38
Message-ID: <MP************************@iww.cacti.ch.alstom.co m>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
X-Trace: individual.net EDsyjQX3Ylden+Jgon+shgwH4MEpA3U1bOlvs81VC24lfdVNz8
X-Orig-Path: h02374
X-Newsreader: MicroPlanet Gravity v2.60
X-Original-NNTP-Posting-Host: cwbad10019.ch.power.alstom.com
X-Original-Trace: 7 Dec 2004 13:01:47 +0100, cwbad10019.ch.power.alstom.com
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.phx.gbl!newsfeed00.s
ul.t-online.de!t-online.de!news-lei1.dfn.de!news-ber1.dfn.de!fu-berlin.de!un
i-berlin.de!individual.net!not-for-mail
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7945
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Hi there ..

I have the following scenario.

I have a Webservice which is running under Win2003/IIS6 with .Net1.1 The
Service itselfs connects to a database which is a SQL 2000 on a Server
in the same domain.

Client is a Windows Form Client (no ASP.NET yet) which connects to the
WebService. Before WebService I would make a SQL Server connection with
the Username & Password specified in the Client and then in the stored
procedure I could get the actual User and limit my sql statements to
this user ...

for example

select jobname from jobs where owner = current_user

It didnt use Windows Authentication so I could change the credentials in
the client without logging into Windows with a different user ...

I though of a similiar approach for the Webservice ...

But here not the client is creating the SQL Server connection. So I
would have to pass the Username & password each time when accessing a
Webservice function?

If I use authentication in IIS (with removing the anonymous access) I
must have the user creating in the Windows Domain, right? But I only
want them in the SQL Server.

How would you solve this? Client which access Webservice which then
access the SQL Database.
--
mfg
Marc Eggenberger

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: thenetflyer | last post by:
<!-- The following sample should authorize the user to log on the site. This works once but after refreshing the browser, it does not prompt again for login until all browser (IE 6) windows are...
13
by: joltman | last post by:
We're working on an intranet site where we will require user's to only be able to access their own page in some instances. Rather than introducing another password to the mix, we were thinking...
3
by: Marc Eggenberger | last post by:
Hi there. I have the following environment: Active Directory running on Windows 2000. There is a root domain called ad.sys and within this root domain there are the following subdomains: ...
13
by: ALI-R | last post by:
I know how to authenticate to a webservice using either of these ways(Assuming that rService represents the webservice): 1) rService.Credentials = new...
1
by: EricRybarczyk | last post by:
I am starting a rewrite of an existing Classic ASP web site in ASP.NET 2.0. The existing ASP application has several types of users, each with a separate login process (separate login page,...
1
by: Arpan | last post by:
Suppose a web.config file (existing in C:\Inetpub\wwwroot\ASPX) has the following code: <configuration> <system.web> <authentication mode="Forms"> <forms name="AuthenticateUser"...
1
by: fomalhaut | last post by:
Hi All, I'm builing an application that requires domain admin access to run, and I'm trying to allow for the application to be run as a normal user and allow the user to provide it with a...
0
sing4you
by: sing4you | last post by:
We have a web-based application where we authenticate users. Users get to the reports via links in the application. No one is sent directly to the Report Manager. We have tried Windows...
4
by: Jon | last post by:
I am modifying an app for a customer in ASP.Net 1.1. The app is running on a server outside their network, yet they want to authenticate users against their internal active directory set up (they...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.