Esempio n. 1
0
        public static void ConfigureOAuth(IAppBuilder app, MessangerDbContext dataContext)
        {
            OAuthAuthorizationServerOptions authorizationServerOptions = new OAuthAuthorizationServerOptions
            {
                AllowInsecureHttp         = true,
                TokenEndpointPath         = new PathString("/api/account/login"),
                AccessTokenExpireTimeSpan = TimeSpan.FromHours(1),
                Provider = new AuthorizationServerProvider(dataContext)
            };

            app.UseOAuthAuthorizationServer(authorizationServerOptions);
            app.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions());
        }
Esempio n. 2
0
 public AccountController()
 {
     dbContext = new MessangerDbContext();
 }
Esempio n. 3
0
 public DialogController()
 {
     dbContext = new MessangerDbContext();
 }
Esempio n. 4
0
 public AuthorizationServerProvider(MessangerDbContext dataContext)
 {
     _dataContext = dataContext;
 }