The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
[UWP]UWP to WCF Service With custom binding Username Authentication RRS feed

  • Question

  • Hi Team,

    UWP application was not able to connect to WCF service in all authentication modes of earlier versions of Windows 10 version 1709(Earlier than specified).

    Once Windows 10 OS upgraded to Version1709(Build 16299 ) and UWP application targeted to Windows UWP SDK 10.0 16299,

    We are able to connect to WCF Service With Windows authentication mode only.

     NetTcpBinding binding = new NetTcpBinding();
     binding.Security.Mode = SecurityMode.Transport;
     binding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Windows;

    When UWP application trying to Connect to WCF service which having Username Authentication (Secured or Unsecured), the below exception was thrown. Using Custom Binding with the below binding element it is throwing exception as below. 

    CustomBinding binding = new CustomBinding();
    TransportSecurityBindingElement userNameOverTransportSecurityBindingElement = SecurityBindingElement.CreateUserNameOverTransportBindingElement();
    userNameOverTransportSecurityBindingElement.MessageSecurityVersion =             MessageSecurityVersion.WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10;
     binding.Elements.Add(userNameOverTransportSecurityBindingElement);

    {System.PlatformNotSupportedException: TransportSecurityBindingElement.BuildChannelFactoryCore is not supported.

       at System.ServiceModel.Channels.TransportSecurityBindingElement.BuildChannelFactoryCore[TChannel](BindingContext context)

    So, I have gone through Microsoft forums and identified that UWP 10.0 16299 is built on .net core 2.2 which does not support Bindings related to Secured and unsecured username authentication.

    Through the forums we found that issue will be solved in .net core 3.0 which is in release phase.

    https://github.com/dotnet/wcf/issues/1257

    https://github.com/dotnet/wcf/issues/8

    https://github.com/dotnet/wcf/issues/13

    Currently they released .net core 3.0 preview. May i know when Microsoft releases UWP SDK which uses .net core 3.0. 

    Please let me know if need more details. Please let me know if need to try in any other ways to talk to WCF Service with User Name Authentication.  




    Monday, August 12, 2019 4:37 AM

All replies

  • Currently they released .net core 3.0 preview. May i know when Microsoft releases UWP SDK which uses .net core 3.0.

     Please refer .net core support policy official website , you could get  .net core 3.0 releases data and history release log https://dotnet.microsoft.com/platform/support/policy/dotnet-core.

    Please let me know if need to try in any other ways to talk to WCF Service with User Name Authentication.

    There are many incompatible feature in WCF communicating with uwp platform, For security reason we suggest use ASP.Net to

    create your service and use OAuth 2.0 to Authentication


    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, August 12, 2019 9:07 AM