Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.UseCookieAuthentication(new CookieAuthenticationOptions
- {
- AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
- LoginPath = new PathString("/Account/Logon"),
- Provider = new CookieAuthenticationProvider
- {
- // Enables the application to validate the security stamp when the user logs in.
- // This is a security feature which is used when you change a password or add an external login to your account.
- OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
- validateInterval: TimeSpan.FromMinutes(30),
- regenerateIdentity: (manager, user) => manager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie))
- }
- });
- PublicClientId = "self";
- OAuthOptions = new OAuthAuthorizationServerOptions()
- {
- AllowInsecureHttp = true,
- TokenEndpointPath = new PathString("/api/v1/auth/token"),
- AccessTokenExpireTimeSpan = TimeSpan.FromDays(1),
- Provider = new ApplicationOAuthProvider(PublicClientId)
- };
- // Token Generation
- app.UseOAuthAuthorizationServer(OAuthOptions);
- app.UseOAuthBearerTokens(OAuthOptions);
- app.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement