Skip to content

i4004/Owin.Security.AesDataProtectorProvider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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();
    }
}