Re: Web Service invoke as NT User
- From: "John Saunders [MVP]" <john.saunders at trizetto.com>
- Date: Thu, 5 Jul 2007 22:25:10 -0400
<backwards15@xxxxxxxxx> wrote in message news:1183599583.519886.156240@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
** This is the windows form code **....
Private Sub btn_log_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btn_log.Click
Dim ws As New ADWS.Service....
MessageBox.Show(ws.GetCurrentUserEmail)....
End Sub' Is any of this code relevant to the problem at hand? What happens if you try:
** This is the webservice code **
<WebMethod()> _
Public Function GetCurrentUserEmail() As String
Return User.Identity.Name
End Function
When I try to run ws.getcurrentuseremail() it invokes the web service
as IUSR_Computername.
How did you determine this? From Environment.Username? Try User.Identity.Name instead.
How ever if I run the web service directly it runs as my account
domain
\username
What do you mean "run the web service directly"? I'm not sure I understand.
How do I get the web service to run from the windows app as the
locally logged on user?
You don't want it to run as the locally logged on user. You want it to run as the user issuing the web service call (which I'll admit, in your case, happens to be the user logged in to the web site, which, if it's on your development machine, is always the locally logged on user).
How do you have the web.config? Do you have <authentication mode="Windows" /> and <identity impersonate="true"/> in the web.config of the web application? Are both applications running in IIS? If so, do you have the directory security set up for Windows Authentication only (disable anonymous access).
--
John Saunders [MVP]
.
- References:
- Web Service invoke as NT User
- From: backwards15
- Web Service invoke as NT User
- Prev by Date: RE: WSHttpBinding in WCF
- Next by Date: Attachments
- Previous by thread: Web Service invoke as NT User
- Next by thread: Win Server 2003 SP2 : slow response
- Index(es):
Relevant Pages
|