title: ASP .NET Core Identity SignInManager
body: <p>Good day. ASP.NET-Core project was with out authentication. So, I tried to add built-in Identity for this purpose. Tables in database successfully created, new user registered. In Account controller in Login Method <code>SignInManager</code> return success in process. In partial view, where links for Login\Register added injection and library (all looks as default project with authentication, based on its implementation): </p>
  
  <pre><code>@using Microsoft.AspNetCore.Identity
  @inject SignInManager&lt;ApplicationUser&gt; SignInManager
  </code></pre>
  
  <p>Then in view checking:</p>
  
  <pre><code>SignInManager.IsSignedIn(User)
  </code></pre>
  
  <p>After Login it's always false, irrelevant moment ago state for login in controller was success. Have I missed to add something at <code>Configuration</code> in <code>Startup.cs</code> or some else? Implemented all things as in default VS project with authentication.</p>
  
  <p>Upd. Configuration in <code>Startup.cs</code></p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
      {
          services.AddDbContext&lt;ApplicationDbContext&gt;(options =&gt;
          options.UseMySql("Server=; Database=; Uid=;Pwd=;"));
  
          services.AddIdentity&lt;ApplicationUser, IdentityRole&gt;(options =&gt;
          {
              options.Password.RequireDigit = true;
              options.Password.RequiredLength = 6;
              options.Password.RequireNonAlphanumeric = false;
              options.Password.RequireUppercase = true;
              options.Password.RequireLowercase = false;
  
              options.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromMinutes(5);
              options.Lockout.MaxFailedAccessAttempts = 5;
  
              options.User.RequireUniqueEmail = true;
              options.SignIn.RequireConfirmedEmail = true;
          })
              .AddEntityFrameworkStores&lt;ApplicationDbContext&gt;()
              .AddDefaultTokenProviders();
  
          // Here added my application services. 
          .......
  
          services.AddMvc();
      }
  
      public void Configure(IApplicationBuilder app, IHostingEnvironment env)
      {
  
          if (env.IsDevelopment())
          {
              app.UseDeveloperExceptionPage();
              app.UseBrowserLink();
              app.UseDatabaseErrorPage();
          }
          else
          {
              app.UseExceptionHandler("/Home/Error");
          }
  
          app.UseStaticFiles();
  
          app.UseAuthentication();
  
          app.UseMvc(routes =&gt;
          {
              routes.MapRoute(
                  name: "default",
                  template: "{controller=Home}/{action=Index}/{id?}");
          });
      }
  </code></pre>