Please note that version 9 is still in beta. For documentation on the latest stable release, please change to version 8.
Contribute to Docs Contribute to Docs

Simple Authentication

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 the HttpContext in order to sign in a user and can't be used for other types of applications.


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

PM> install-package Piranha.AspNetCore.SimpleSecurity

Registering The Service

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

    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.