Basic Authentication with WCF REST service to something other than windows accounts?

前端 未结 5 969
独厮守ぢ
独厮守ぢ 2020-12-12 16:40

Is there a clean way to expose a WCF REST service that requires basic authentication, but where we handle the actual validation of the username/password ourselves? It seems

5条回答
  •  一个人的身影
    2020-12-12 17:12

    If you host it on IIS, using custom http module is the way to go. You can bring over the principal over to WCF side to do code access security. See HTTP Basic Authentication against Non-Windows Accounts in IIS/ASP.NET (Part 3 - Adding WCF Support). Also see Custom HTTP Basic Authentication for ASP.NET Web Services on .NET 3.5/VS 2008.

    If you are not using IIS, you should be able to implement userNameAuthentication. See Finally! Usernames over Transport Authentication in WCF.

提交回复
热议问题