Simple Security

Last Updated: 2018-12-04

The Simple Security implementation is a simple user & authentication manager for development purposes. It does not persist any user data, instead the current user accounts are added into memory on application startup. It is not recommended to use Simple Security for production environments.

Simple Security depends on a HttpContext in order to sign in a user and can't be used for other types of applications.

Installation

The Simple Security can be installed by adding the NuGet package:

Piranha.AspNetCore.SimpleSecurity

Registering The Service

You register Simple Security in ConfigureServices() with the following call:

services.AddPiranhaSimpleSecurity(
new Piranha.AspNetCore.SimpleUser(Piranha.Manager.Permission.All())
{
UserName = "admin",
Password = "password"
},
...
);

Here you can create any number of users with different permissions that you need for your development environment.