none
UWP to WCF service with message security username authentication. RRS feed

  • Question

  • Hi,

    I am working to connect to WCF service with Message security from UWP app. It is throwing below exception.

    System.PlatformNotSupportedException: TransportSecurityBindingElement.BuildChannelFactoryCore is not supported.

    My scenario is most similar to the issue :

    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/0ff6908e-329c-4558-be07-76851eb902ad/uwpuwp-apps-wcf-security?forum=wpdevelop

    We are using nettcp requests to get the response.

    Issue is with the SecurityBindingElement.CreateUserNameOverTransportBindingElement(). 

    Do we have any approach to work with message security in UWP with Username and SSL authentication.

    Please let me know if need more information.

    Thank you,

    Nagarjuna

    Monday, May 20, 2019 5:16 AM

All replies

  • Hi,

    First of all, UWP now is using .net core 2.0. And the API you are using SecurityBindingElement.CreateUserNameOverTransportBindingElement() is not supported in .net core 2.0. You could check it here:.NET API Browser.

    I'll move the thread to Windows Communication Foundation, Serialization, and Networking forum. You could get more professional support there.

    Best regards,

    Roy


    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 MSDNFSF@microsoft.com.

    Monday, May 20, 2019 8:34 AM
  • Hi NagarjunaBusireddy,
    WCF security mode, TransportWithMessageCredential is not supported by Core2.0+, you could refer to the following link.
    https://docs.microsoft.com/en-us/dotnet/api/system.servicemodel.channels.securitybindingelement.createusernameovertransportbindingelement?view=netframework-4.8
    Feel free to let me know if there is anything I can help with.
    Best Regards
    Abraham
    Monday, May 20, 2019 10:03 AM
    Moderator
  • Thank you for the reply Abraham.

    With one of my requirement i need to use SecurityBindingElement.CreateUserNameOverTransportBindingElement(), Can we use the above method by referring to .net core 1.0?

    If yes, how can refer in UWP app. Currently i am using UWP targeted to Winodws 10 Fall Creators Update.

    We are upgrading Windows 8.1 app to UWP. Since WCF username authentication has been working in Windows 8.1 app, we have to provide the similar capability in upgraded UWP app.

    Regards,

    Nagarjuna

    Tuesday, May 21, 2019 11:58 AM
  • Hi,

    Are you currently consuming services? If it is (calling the service by adding a service reference), then the UWP runtime environment is not allowed. I am not familiar with UWP. For web applications we can change the runtime environment explicitly. 
    At least for the moment, the UWP template I created does not support transport layer security.
    https://i.stack.imgur.com/ducCq.png
    You can give feedback to the product group, refer to below discussion.
    https://github.com/dotnet/wcf/issues/8

    Best Regards

    Abraham

    Wednesday, May 22, 2019 7:39 AM
    Moderator