WCF data security in a WPF application

I am working on a solution where I have a WPF project that uses the WCF DataService, which is in another ASP.NET project to access data.
I need to provide a level of security that ensures that only authenticated users can access the service. Having caught the net, I broke my head, trying to do it. What is the correct way to implement it?

+5
source share
1 answer

I did this before when the WCF method Logincreated the user object, assigned the user object token (in my case it was a GUID) and stored it inside on the WCF server in AuthenticatedUsers.

Any other WCF call requires a token as a parameter. It will check if the user existed in the list AuthenticatedUserswith this token and would return an error if there were no user with this token. An added benefit is that I always knew who made the WCF call without requiring them to pass in the user ID.

LastActivity DateTime User . WCF , AuthenticatedUsers WCF , , AuthenticatedUsers LastActivity , 20 .

+2

All Articles