Skip to content

Instantly share code, notes, and snippets.

@phillipsj
Created October 8, 2015 01:00
Show Gist options
  • Save phillipsj/b4b6ba3367b48bb37cc6 to your computer and use it in GitHub Desktop.
Save phillipsj/b4b6ba3367b48bb37cc6 to your computer and use it in GitHub Desktop.
Setting DataProtectionProvider Alternative
public class OwinMiddlewares : IOwinMiddlewareProvider {
public ILogger Logger { get; set; }
public OwinMiddlewares() {
Logger = NullLogger.Instance;
}
public IEnumerable<OwinMiddlewareRegistration> GetOwinMiddlewares() {
var middlewares = new List<OwinMiddlewareRegistration>();
middlewares.Add(new OwinMiddlewareRegistration
{
Priority = "9",
Configure = app => {
app.SetDataProtectionProvider(new MachineKeyProtectionProvider());
}
});
return middlewares;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment