locked
WCF service - pass app pool credentials RRS feed

  • Question

  • Hi,

    I have a WCF service where I want to pass the credentials of the application pool under which it is running.
    I tried default credentials to the service object and also few other options but always landed up in not authorized error.

    Wednesday, February 1, 2012 6:48 AM

Answers

  • This depends on your remote service's configuration. If the remote service uses SSL, you need to configure your service's client endpoint (the endpoint which connects to the remote service, not the service endpoint) to use transport security and Windows authentication. If the remote service uses message security, you need to use message security as well. Same for other configurations.
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    If you have feedback about forum business, please contact msdnmg@microsoft.com. But please do not ask technical questions in the email.
    • Marked as answer by Yi-Lun Luo Tuesday, February 7, 2012 11:34 AM
    Friday, February 3, 2012 1:14 AM

All replies

  • Hello, to where do you want to pass the credentials? If you mean you want to pass the IIS application pool credentials from your service to a remote endpoint (such as a database or another service), you need to check if the remote endpoint requires Windows authentication, and make sure you're not using impersonation.
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    If you have feedback about forum business, please contact msdnmg@microsoft.com. But please do not ask technical questions in the email.
    Wednesday, February 1, 2012 11:34 AM
  • I need to pass the IIS application pool credentials from my service to another target web service within the same server. This target web service accepts windows authentication. Can you please give me a sample code?

     

    Wednesday, February 1, 2012 11:52 AM
  • Cutloo,

    Set your security mode to 'Transport' and the credentialtype to 'Windows'. You will call the target web service with the credentials of the app pool hosting your client code. Both client and service have to set the security mode and credentialtype.


    If this post answers your quenstion, please mark it as such. If this post is helpful, click 'Vote as helpful'.
    Wednesday, February 1, 2012 12:17 PM
  • Where should I set the secuirty mode to "Transport", in the web.config file of my WCF? am new to WCF hence not sure of the location.

    Am calling a sharepoint web service so I cannot change the settings in the web service. But the web service and WCF service are running under the same account.

    Wednesday, February 1, 2012 12:43 PM
  • This depends on your remote service's configuration. If the remote service uses SSL, you need to configure your service's client endpoint (the endpoint which connects to the remote service, not the service endpoint) to use transport security and Windows authentication. If the remote service uses message security, you need to use message security as well. Same for other configurations.
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    If you have feedback about forum business, please contact msdnmg@microsoft.com. But please do not ask technical questions in the email.
    • Marked as answer by Yi-Lun Luo Tuesday, February 7, 2012 11:34 AM
    Friday, February 3, 2012 1:14 AM