Re: Passing user credintials from a web page to a web service.



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




.



Relevant Pages

  • Re: Cached Logon
    ... > current credentials and only after failing would prompt for credentials. ... Keep in mind that whether the IE browser will supply the Windows ... the scenes" windows authentication information? ... > On the server I was logged in as domain1\administrator. ...
    (microsoft.public.sqlserver.connect)
  • Re: Cached Logon
    ... > current credentials and only after failing would prompt for credentials. ... Keep in mind that whether the IE browser will supply the Windows ... the scenes" windows authentication information? ... > On the server I was logged in as domain1\administrator. ...
    (microsoft.public.sqlserver.server)
  • Re: Cached Logon
    ... > current credentials and only after failing would prompt for credentials. ... Keep in mind that whether the IE browser will supply the Windows ... the scenes" windows authentication information? ... > On the server I was logged in as domain1\administrator. ...
    (microsoft.public.win2000.networking)
  • Re: Cached Logon
    ... > current credentials and only after failing would prompt for credentials. ... Keep in mind that whether the IE browser will supply the Windows ... the scenes" windows authentication information? ... > On the server I was logged in as domain1\administrator. ...
    (microsoft.public.inetserver.iis)
  • Re: Cached Logon
    ... > current credentials and only after failing would prompt for credentials. ... Keep in mind that whether the IE browser will supply the Windows ... the scenes" windows authentication information? ... > On the server I was logged in as domain1\administrator. ...
    (microsoft.public.sqlserver.security)