Using ASP.NET Membership Provider authentincation in a WCF service

前端 未结 1 1920
既然无缘
既然无缘 2021-01-31 11:20

Is there a way to use the same username and password from the membership provider for a WCF service authentication? if so, which binding does it supports? I need to extract a pr

1条回答
  •  北恋
    北恋 (楼主)
    2021-01-31 11:35

    Basically any binding that accepts username/password as client credentials for message security can be configured to use the ASP.NET membership provider.

    Check out this MSDN docs on how to use the ASP.NET Membership provider in WCF - you need to configure your binding for client credentials of type "UserName"

    
      
      
        
          
            
          
        
      
    
    

    and the service to use ASP.NET Membership for user authentication:

    
      
         
            
         
      
    
    

    and of course, you have to apply this service behavior to your services when configuring them!

    
       
       ....
       
    
    

    The UserName client credential type is supported by basicHttpBinding, wsHttpBinding, netTcpBinding - so pretty much all the usual suspects.

    0 讨论(0)
提交回复
热议问题