i4004 / Owin.Security.AesDataProtectorProvider

OWIN AES data protector provider

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Owin.Security.AesDataProtectorProvider

Nuget Version Nuget Download Build PackageLibraries.io dependency status for latest release CodeFactor Grade Platform

Owin.Security.AesDataProtectorProvider - is an AES cryptic provider for OWIN authentication middlewares. It is based on managed and CSP .Net framework providers.

Examples

Registration

public class Startup
{
    public void Configuration(IAppBuilder app)
    {
        ...
        app.UseAesDataProtectorProvider();
        ...
    }
}

Usage with custom key

...
app.UseAesDataProtectorProvider("my key");
...

Enabling usage with FIPS-compliant CSP provider

...
app.UseAesDataProtectorProvider(null, true);
...

or

...
app.UseAesDataProtectorProvider("my key", true);
...

Usage example with cookie authentication

public class Startup
{
    public void Configuration(IAppBuilder app)
    {
        app.UseCookieAuthentication(new CookieAuthenticationOptions
        {
            AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
            LoginPath = new PathString("/login")
        });

        app.UseAesDataProtectorProvider();
    }
}

About

OWIN AES data protector provider

License:GNU Lesser General Public License v3.0


Languages

Language:C# 100.0%