RE: Failure to set credentials

From: Steven Cheng[MSFT] (stcheng_at_online.microsoft.com)
Date: 07/21/05


Date: Thu, 21 Jul 2005 02:45:41 GMT

Hi Philip,

Welcome to .NET newsgroup.
As for the INFO PATH form setting credentials for webservice proxy problem,
here are some of my suggestions:

First, I agree with you that this is a security problem and more exactly,
it's a .net's CAS problem. To make problem more clear, I suggest you try
the following things:

1. As you mentioned that the form work well when running from your local
computer. If so, is the local computer the develop machine of that form?
Please try copy the form to some other machine and run it to see whether it
also works as on your local machine.

2. If the infopath form also works on other machine (running from local), I
think it's likely due to the seuciryt restriction for the downloaded
infopath form from SPS FORM library. We'll need to do some further research
on the LOCAL .NET CAS setting for remote component.

If there're anything unclear or other new findings, please feel free to
post here.
Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| From: "Philip Colmer" <pcolmer@newsgroup.nospam>
| Subject: Failure to set credentials
| Date: Wed, 20 Jul 2005 15:25:11 +0100
| Lines: 41
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
| X-RFC2646: Format=Flowed; Original
| Message-ID: <uz9jXbTjFHA.3540@TK2MSFTNGP14.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.security
| NNTP-Posting-Host: host-news.chadwyck.co.uk 195.22.151.243
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.security:6030
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.security
|
| I've written a web service that returns some user-specific information.
I'm
| calling that web service from an InfoPath form as managed code:
|
| MsgBox("Calling WhoAmI service", MsgBoxStyle.OKOnly, "OnLoad")
| Try
| svc.Credentials =
| System.Net.CredentialCache.DefaultCredentials()
| MsgBox("Set service credentials", MsgBoxStyle.OKOnly,
| "OnLoad")
| Try
| _Initials = svc.GetInitials("")
| MsgBox("Got '" & _Initials & "'", MsgBoxStyle.OKOnly,
| "OnLoad")
| Catch ex As Exception
| MsgBox("Failed to get initials: " & ex.ToString,
| MsgBoxStyle.OKOnly, "OnLoad")
| End Try
| Catch ex As Exception
| MsgBox("Failed to set credentials: " & ex.ToString,
| MsgBoxStyle.OKOnly, "OnLoad")
| End Try
| svc.Dispose()
| MsgBox("Disposed of service object", MsgBoxStyle.OKOnly,
| "OnLoad")
|
| If I've got the form on my computer, it works fine - it sets the
| credentials, gets my initials back from the web service & disposes of the
| object. If, however, I publish the form to a SharePoint forms library and
| open the form from there, the call to svc.Credentials fails with:
|
| System.Security.SecurityException: Request for the permission of type
| System.Security.Permissions. EnvironmentPermission, mscorlib,
| Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed.
|
| The web service is configured to use integrated windows authentication.
|
| Can anyone tell me how to resolve this, please?
|
| --Philip
|
|
|



Relevant Pages

  • Re: Windows authentication for web service client??
    ... If you are posting to WEBDAV it is my understanding that you cannot use Integrated authentication since you HAVE to pass it the username and the password in the network credentials. ... I must put together a sample example, but for some reason the users credentials are lost when making the WebDAV request. ... web service is running ASPNET account. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: Calling Web Service that calls other Web Service with Windows Authentication
    ... You are passing credentials (by ... services - then you do not need to pass token remotely and windows can ... Given a windows application client that's calling a web service (using ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Passing credentials from ASP.NET website to webservice
    ... I have a problem with passing the default credentials from an ASP.NET web ... The EMM web applications access the MSCRM ... Web services which is part of the MS CRM server setup. ... since both the EMM web application and the web service reside on the same IIS ...
    (microsoft.public.inetserver.iis.security)
  • Re: Server Time Out
    ... could be not passing user credentials to the web service from the client. ... calling a remote server from a web server due to not being able to forward ...
    (microsoft.public.dotnet.framework.aspnet.webservices)