Esempio n. 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"));
        }
Esempio n. 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());
        }
Esempio n. 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());

        }
Esempio n. 4
0
 public Repository(GameContesterDbContext context)
 {
     this.Context = context;
 }
Esempio n. 5
0
 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"));
 }