472,958 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How to pass user credentials from a windows app to a web service?

Hi,
I'm trying to authenticate the user based on the credentials that I get
from the client app, but I'm getting empty string as user name. Can somebody
tell me if I'm doing anything wrong here. Thanks in advance!

Here is what I'm doing:

In the windows app, I've set the current security principal as
windowsprincipal

When I'm making to call to web service, I've tried both these things:

1)

MyService service = new MyService();

WebProxy proxy = new WebProxy(service.Url, true);
service.Proxy = proxy;

2)
MyService service = new MyService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials

In the vroot security settings for the web service, I've set the
authentication to IntegratedWindowsAuthentication

In the web.config of the web service, I've set to allow all users.
But in both cases, I'm not able to access the user name in the web service.
If I go to web service via the default UI, I'm able to access the username
fine.

Any help is greatly appreciated!
Nov 23 '05 #1
1 10105
You mentioned that you checked Integrated Windows Authentication, but did you
UNCHECK "Anonymous access"? If you allow Anon access at all, it will never
bother with the credentials.
Also make sure you web.config file has the following entries in it:
<authentication mode="Windows" />
<identity impersonate="true" />

Hope that helps,

John

"webserviceUser189" wrote:
Hi,
I'm trying to authenticate the user based on the credentials that I get
from the client app, but I'm getting empty string as user name. Can somebody
tell me if I'm doing anything wrong here. Thanks in advance!

Here is what I'm doing:

In the windows app, I've set the current security principal as
windowsprincipal

When I'm making to call to web service, I've tried both these things:

1)

MyService service = new MyService();

WebProxy proxy = new WebProxy(service.Url, true);
service.Proxy = proxy;

2)
MyService service = new MyService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials

In the vroot security settings for the web service, I've set the
authentication to IntegratedWindowsAuthentication

In the web.config of the web service, I've set to allow all users.
But in both cases, I'm not able to access the user name in the web service.
If I go to web service via the default UI, I'm able to access the username
fine.

Any help is greatly appreciated!

Nov 23 '05 #2

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

Similar topics

3
by: Jørn A. | last post by:
I'm working on a web based user interface for a job scheduling system (running scripts). The system is using a non-windows scheduler software, but it's installed and running as a windows...
3
by: cmueller | last post by:
Hey all - I'm in a bit of a bind concerning web services and integrated authentication. I'll give you a little background as to what I'm trying to do ... I have a client application that...
2
by: elora_c | last post by:
I'm making a call to a webservice from my ASP.NET page. The web application has anonymous access turned off and Integrated Windows auth turned on. The web.config has <identity impersonate=true>. ...
4
by: James | last post by:
I succesfully pass username , domain and password via this function (taken from MSDN) Private Declare Auto Function LogonUser Lib "advapi32.dll" (ByVal lpszUsername As , _ ByVal lpszDomain As...
3
by: ssg31415926 | last post by:
I administer a Server 2003/XP network. A developer has come to me with a proposal to put in a web service-based application. The workstations will be XP and the servers 2003 but he can't use...
0
by: Eagle | last post by:
Hi all. I want to known if it is possible to pass the Credentials (user and pass basicly) from one user I has validated in my intranet to another aplication (for example to an object who can...
18
by: Arthur | last post by:
Hi All, I would like to get the name of the user given their networkID, is this something Active Directory would be useful for?(For intranet users) If so, can you please point me to some sample...
9
by: webrod | last post by:
Hi all, how can I check a user/password in a LDAP ? I don't want to connect with this user, I would like to connect to LDAP with a ADMIN_LOG/ADMIN_PWD, then do a query to find the user and...
5
by: Max2006 | last post by:
Hi, I am trying to limit my wcf service endpoint to response to only given windows user or group. How can I do that? Is there any way to configure that in the .config file? Thank you, Max
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.