Pass basic authentication to invoke another internal wcf service RRS feed

  • Question

  • We have WCF service A running to use basic authentication. Inside of this service, we will use another wcf service (B) which is hosted at the same machine. 

    The internal WCF service  (B)  uses basic authentication as well. 

    Now, I set up the both service use the same credentials. I hope when sending request for service A, the credential could be used for internal call to service B. 

    I tried to use ServiceSecurityContext.PrimaryIdentity.Name. I could get the current user name from service request. However , I cannot pass the password to build up the clientCredentilas.UserName.Password. 

    If I hard coded the password in the code, this invocation got passed through. I don't want to embedded the password in code or in the configuration file. How do I get the current session's credential to pass into second clientcredential? 

    Did anyone have some idea ?


    Thursday, February 27, 2020 2:37 PM

All replies

  • Hi HappyMaggie, 

    Welcome to MSDN forum. 

    According to your description, I suppose this issue is more about WCF and our forum is to discuss .NET Framework Setup and Servicing issue. I suggest you could redirect to Stack Overflow tagged wcf forum, and start a new thread for a more professional help.

    If you have any more .NET Framework Setup and Servicing issues in the future, please feel free to let us know.

    Sorry for any inconvenience and thanks for your understanding. 

    Best Regards,


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Friday, February 28, 2020 3:49 AM