Re: Passing user credintials from a web page to a web service.
- From: Brock Allen <ballen@xxxxxxxxxxxxxxxxx>
- Date: Tue, 05 Apr 2005 19:44:45 -0700
If you're using Basic authentication the username is available via HttpContext.Current.User.Identity and the password is in some server variable (Enable Tracing to check which one). Use this info to set the Credentials property on your webservice proxy using ther NetworkCredentials class.
If you're using any other authentication mechanism you've got a problem since you don't have a password. It's the classic 2nd hop authentication issue. You need to somehow acquire the password from the user. The reason basic authentication works is because the password is sent as a header to the server when the user is challenged in the browser.
-Brock DevelopMentor http://staff.develop.com/ballen
I'm sure this is easy and I'll be embarrassed when I see the answer, but I just can't figure this one out. Using .Net/ASP 1.1 on a server using integrated authentication-- I have a web page (.aspx) that will collect some data from the user, call a web service to get additional data, and then merge and format the data back to the user's browser. But I want the web service to authenticate with the user's credentials, not the credentials of IIS serving the aspx page. What the web service will or will not return is based on who is making the request. How do I pass the user's credentials to the web service? Sample code, white paper, knowledge base article, any clue will be welcome. Thanks in advance.
Dan
.
- References:
- Passing user credintials from a web page to a web service.
- From: Dan Higman
- Passing user credintials from a web page to a web service.
- Prev by Date: Single User Login At A Time
- Next by Date: Re: Single User Login At A Time
- Previous by thread: Passing user credintials from a web page to a web service.
- Next by thread: Re: Passing user credintials from a web page to a web service.
- Index(es):
Relevant Pages
|