Authentication of each call in WCF

I have a silverlight application that calls my wcf services, so this is basichttpbinding. and we use authentication. I want to do authentication for every call I receive, except for the "Authentication service" (since this is the method that will perform basic authentication for logging in), so after the user logs in and tries to call other services, I want this authentication, verify that it is performed so that access is granted to authorized users only. Is there a better way to implement this ... ???

After searching various blogs, I found out that we can use the HttpContext.Current .... IsAuthenticated property to authenticate the user or not. But my question is, how safe and acceptable is HttpContext? Can we rely on this? or should we use OperationContext? (and yes, aspnetcompatability is set to true).

Please suggest !!

Thanks in advance Sai

+3
source share
2 answers

If you host your WCF services during ASP.NET runtime (i.e. <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />), you should absolutely be able to rely on ASP.NET security.

, ASP.NET ASMX. WCF, ASP.NET .

+2

Source: https://habr.com/ru/post/1722025/