O'Reilly logo

.NET Domain-Driven Design with C#: Problem – Design – Solution by Tim McCarthy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. The Client Membership System

In the last chapter, I talked about synchronizing data with the server and how important it was to be able to work offline. In this chapter, I am going to discuss how to implement membership features, such as authentication, in an offline scenario.

The Problem

Now that the application has a nice, service-based way of working offline and synchronizing all of its data with the server, there needs to be a way to enable authentication and authorization while offline as well.

Users should be able to authenticate (i.e., log in to the application) and be able to perform work based on their assigned role(s) in the system. This is easy to do in an online ASP.NET application using the ASP.NET Membership System, but it is a lot trickier in a smart client application. One way of implementing these features is to call web services on the server that will authenticate the user and provide authorization information. The web services could actually wrap methods on the ASP.NET Membership System. The problem with that approach in the SmartCA application is that it requires that the user has a network or Internet connection, and if you remember from Chapter 1, the users sometimes are out in the middle of nowhere with no access to any type of network connection.

The Design

Since I already have a nice data synchronization strategy in place, why not use that to help solve the problem of performing membership tasks offline? After thinking about it for a while, I thought, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required