Created
November 12, 2016 21:07
-
-
Save johnmmoss/b379ae68a786d237334f2897ef495e20 to your computer and use it in GitHub Desktop.
Sample Identiy Config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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