Re: Web Service invoke as NT User



<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


** This is the webservice code **

<WebMethod()> _
Public Function GetCurrentUserEmail() As String
' Is any of this code relevant to the problem at hand? What happens if you try:
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]

.



Relevant Pages

  • Windows Authentication to Web Service
    ... The responsibility of this web service is to access a paradox db on the same machine and return datasets, string etc back to the caller. ... The web service only uses Windows Authentication and is ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: WSE 3.0, usernameOverTransportSecurity, custom Token Manager w/ securityTokenManager,
    ... I've added the web service call directly to my Data binding method ... expected but not present in the security header of the incoming ... the username token to the message. ... protected override string AuthenticateToken(UsernameToken token) ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Consume Web Service...
    ... to call a web service in my orchestration. ... Xml parameters as string datatypes and processes this Xml and returns ... ignoreCommit, XMessage msg) ...
    (microsoft.public.biztalk.general)
  • Re: proxy error when consuming web service
    ... public string GetQuote ... I *didn't* pass anything to the proxy property of the service ... 'Assume RemoteWebService is a remote web service proxy class. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: DateTime WebService Discrepancy.
    ... When the datetime is sent by the webservice, ... > Ofcourse I had not even though of just passing a string as a parameter ... > locally and cut out the call to the web service. ...
    (microsoft.public.dotnet.framework.compactframework)