Skip to main content


Showing posts from October, 2016

Consuming a WCF with error: "The caller was not authenticated by the service"

Consuming a WCF service when it hosted on a work group server may cause raise some errors such as: "The caller was not authenticated by the service".
I tackled it by adding the following lines to my code:
client.ClientCredentials.Windows.ClientCredential.Domain = "WorkstationName"; client.ClientCredentials.Windows.ClientCredential.UserName = "blabla"; client.ClientCredentials.Windows.ClientCredential.Password = "blabla123";

Row level security for a table in SQL Server

This post is a question I asked in SO while ago, but I did not got any answer. So because of deletion warning I posted it here.  I've implemented a claim base application by MVC, C#, EF6 and SQL Server 2014. Now there is a new requirement to add row level security on it. The scenario is: We have a table (Product) with nearly 10000 row.User table has n..n relation with Product.All of actions have security attributes to controls users access according to claims.When a user wants to fetch data from db, I want to filter result based on user access. Every user must view the related data.There is a solution for this matter in thisthis but my problem is the rows count in the table (Product). If I create a new table (Product_ACL) to persist users permission to Product records per capita, managing the permission is so hard and full potential of mistakes for the end user to managing users permissions. Update: The normal way to solve my issue is: create table Product(Id INT PRIMARY KEY,Name …