title: ASP.NET WEB API Startup class
body: <p>I am currently using Ninject for the Dependency injection. This project is based on ASP.NET WEB APP 2.  Whenever i run my application, i get the error {app null} in the startup.cs class. and i have An unhandled exception of type 'System.StackOverflowException' occurred in Phase2_Group2_selucmps383_sp15_p2_g2.dll</p>
  
  <pre><code>[assembly: OwinStartup(typeof(Phase2_Group2_selucmps383_sp15_p2_g2.Startup))]
      namespace Phase2_Group2_selucmps383_sp15_p2_g2
      {
          public partial class Startup
          {
              public void Configuration(IAppBuilder app)
              {
                  Configuration(app);
              }
          }
      }
  </code></pre>
  
  <p>The App_Start startup.cs class is :</p>
  
  <pre><code>namespace Phase2_Group2_selucmps383_sp15_p2_g2.App_Start
  {
      public partial class Startup
      {
          public static string PublicClientId { get; private set; }
  
          public static Func&lt;UserManager&lt;IdentityUser&gt;&gt; UserManagerFactory { get; set; }
  
          public static OAuthAuthorizationServerOptions OAuthOptions { get; private set; }
          static Startup()
          {
  
              PublicClientId = "self";
  
              UserManagerFactory = () =&gt; new UserManager&lt;IdentityUser&gt;(new UserStore&lt;IdentityUser&gt;());
  
              OAuthOptions = new OAuthAuthorizationServerOptions
              {
                  TokenEndpointPath = new PathString("/Token"),
                  Provider = new ApplicationOAuthProvider(PublicClientId, UserManagerFactory),
                  AuthorizeEndpointPath = new PathString("/api/Account/ExternalLogin"),
                  AllowInsecureHttp = true
              };
  
          }
  
          public void Configuration(IAppBuilder app)
          {
              var config = new HttpConfiguration();
              config.DependencyResolver = new NinjectResolver(NinjectWebCommon.CreateKernel());
  
              config.Routes.MapHttpRoute("default", "api/{controller}/{id}", new { id = RouteParameter.Optional });
  
              app.UseWebApi(config);
  
  
  
              app.UseCookieAuthentication(new CookieAuthenticationOptions());
              app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
  
              app.UseOAuthBearerTokens(OAuthOptions);
              Configuration(app);
          }
      }
  }
  </code></pre>
  
  <p>What is the issue here? Any help? Would be happy to post anything else if needed.  </p>