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()); }
public AccountController() { dbContext = new MessangerDbContext(); }
public DialogController() { dbContext = new MessangerDbContext(); }
public AuthorizationServerProvider(MessangerDbContext dataContext) { _dataContext = dataContext; }