Owin.Security.AesDataProtectorProvider
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();
}
}