예제 #1
0
        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"));
        }
예제 #2
0
        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());
        }
예제 #3
0
        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());

        }
예제 #4
0
 public Repository(GameContesterDbContext context)
 {
     this.Context = context;
 }
예제 #5
0
 public UserRepository(GameContesterDbContext context, IUserManager userManager)
     : base(context)
 {
     this.userManager = userManager;
 }
예제 #6
0
 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"));
 }