Skip to content

Instantly share code, notes, and snippets.

@johnmmoss
Created November 12, 2016 21:07
Show Gist options
  • Select an option

  • Save johnmmoss/b379ae68a786d237334f2897ef495e20 to your computer and use it in GitHub Desktop.

Select an option

Save johnmmoss/b379ae68a786d237334f2897ef495e20 to your computer and use it in GitHub Desktop.
Sample Identiy Config
public class IdentityConfig
{
public void Configuration(IAppBuilder app)
{
app.CreatePerOwinContext(() => new TimesheetsContext());
app.CreatePerOwinContext<UserManager>(UserManager.Create);
app.CreatePerOwinContext<RoleManager<Role>>((options, context) =>
new RoleManager<Role>(
new RoleStore<Role>(context.Get<TimesheetsContext>())));
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Home/Login"),
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment