Exemplo 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());
        }
Exemplo n.º 2
0
 public AccountController()
 {
     dbContext = new MessangerDbContext();
 }
Exemplo n.º 3
0
 public DialogController()
 {
     dbContext = new MessangerDbContext();
 }
Exemplo n.º 4
0
 public AuthorizationServerProvider(MessangerDbContext dataContext)
 {
     _dataContext = dataContext;
 }