O'Reilly logo

Xamarin Blueprints by Michael Williams

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

Setting up the AuthenticationRepository

Now we move on to the AuthenticationRepository. This is the object that will handle access and storage using the UserManager framework provided by the Identity.EntityFramework library. Add in a new folder called Repositories, then add a new file called AuthenticationRepository.cs, and implement the following:

Note

The UserManager class is a facade for providing identity management in any ASP.Net application

public class AuthenticationRepository : IDisposable { private AuthenticationContext authenticationContext; private UserManager<IdentityUser> userManager; public AuthenticationRepository() { authenticationContext = new AuthenticationContext(); userManager = new UserManager<IdentityUser>(new UserStore<IdentityUser>(authenticationContext)); ...

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