Skip to content

Latest commit

 

History

History
68 lines (54 loc) · 2.08 KB

File metadata and controls

68 lines (54 loc) · 2.08 KB

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