public UserManager(GameContesterDbContext context) { userManager = new UserManager <User>(new UserStore <User>(context)); var provider = new DpapiDataProtectionProvider("GameContester"); userManager.UserTokenProvider = new DataProtectorTokenProvider <User>(provider.Create("ResetPassword")); }
public void ConfigureOAuth(IAppBuilder app) { var context = new GameContesterDbContext(); var userService = new UserService(new UserRepository(context, new UserManager(context)), new MailService()); OAuthAuthorizationServerOptions OAuthServerOptions = new OAuthAuthorizationServerOptions() { AllowInsecureHttp = true, TokenEndpointPath = new PathString("/token"), AccessTokenExpireTimeSpan = TimeSpan.FromDays(1), Provider = new SimpleAuthorizationServerProvider(userService) }; // Token Generation app.UseOAuthAuthorizationServer(OAuthServerOptions); app.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions()); }
public Repository(GameContesterDbContext context) { this.Context = context; }
public UserRepository(GameContesterDbContext context, IUserManager userManager) : base(context) { this.userManager = userManager; }
public UserManager(GameContesterDbContext context) { userManager = new UserManager<User>(new UserStore<User>(context)); var provider = new DpapiDataProtectionProvider("GameContester"); userManager.UserTokenProvider = new DataProtectorTokenProvider<User>(provider.Create("ResetPassword")); }