The following information is from the SimpleIdentity website:

A simple ASP.NET Core authentication and identity provider, ideal for smaller websites. Valid users are specified in a simple configuration file rather than a database.

Bug reports and feature requests are welcome!

If you are creating a brand new ASP.NET Core web application, ensure you select "No Authentication" when creating it.

Install NuGet package:

Install-Package Daniel15.SimpleIdentity

Create configuration. SimpleIdentity uses the standard ASP.NET configuration library. Running Daniel15.SimpleIdentity.Setup will allow you to enter a email address and password, and output the required config section. An example using user@example.com as the email address and password as the password:

    "Auth": {
        "Users": {
            "USER@EXAMPLE.COM": {
                "Email": "user@example.com",
                "NormalizedUserName": "USER@EXAMPLE.COM",
                "PasswordHash": "AQAAAAEAACcQAAAAEJOYL0MGZ5CNnERvqzI2Wl9eJLXMsuchKP1EIWGQneZ1GuNCjheC4pD1AWgVy+decQ=="
            }
        }
    }

Place this in any config file (for example, config.json). In a production scenario, you will want to store this in a separate config file that's not checked in to source control.

Configure SimpleIdentity in Startup.cs:

public void ConfigureServices(IServiceCollection services)
{
    // Add Identity services to the services container.
    services.AddIdentity<SimpleIdentityUser, SimpleIdentityRole>()
        .AddSimpleIdentity<SimpleIdentityUser>(Configuration.GetConfigurationSection("Auth"))
        .AddDefaultTokenProviders();

Enable identity services by adding this before app.UseMvc:

// Add cookie-based authentication to the request pipeline.
app.UseAuthentication();

Create login form. Some example files are included, based off the regular ASP.NET authentication:

Hit /Account/Login and it should work :)

For a full example, see the included sample project.

  • Upgrade to ASP.NET Core 7.0. Note that if you are upgrading from an older version, you will need to re-hash the passwords by running Daniel15.SimpleIdentity.Setup again.

  • Upgrade to ASP.NET Core 2.0
  • Throw better error message when config is missing

  • Upgrade to ASP.NET Core RTM

  • Upgrade to ASP.NET Core RC 2

  • Upgrade to ASP.NET 5 RC 1

  • Initial release