/// <summary> /// Configure a custom UserStore with the Identity User Manager for Umbraco /// </summary> /// <param name="app"></param> /// <param name="appContext"></param> /// <param name="userMembershipProvider"></param> /// <param name="customUserStore"></param> public static void ConfigureUserManagerForUmbracoBackOffice(this IAppBuilder app, ApplicationContext appContext, MembershipProviderBase userMembershipProvider, BackOfficeUserStore customUserStore) { if (appContext == null) { throw new ArgumentNullException("appContext"); } if (userMembershipProvider == null) { throw new ArgumentNullException("userMembershipProvider"); } if (customUserStore == null) { throw new ArgumentNullException("customUserStore"); } //Configure Umbraco user manager to be created per request app.CreatePerOwinContext <BackOfficeUserManager>( (options, owinContext) => BackOfficeUserManager.Create( options, customUserStore, userMembershipProvider)); //Create a sign in manager per request app.CreatePerOwinContext <BackOfficeSignInManager>((options, context) => BackOfficeSignInManager.Create(options, context, app.CreateLogger(typeof(BackOfficeSignInManager).FullName))); }
/// <summary> /// Configure Default Identity User Manager for Umbraco /// </summary> /// <param name="app"></param> /// <param name="appContext"></param> /// <param name="userMembershipProvider"></param> public static void ConfigureUserManagerForUmbracoBackOffice(this IAppBuilder app, ApplicationContext appContext, MembershipProviderBase userMembershipProvider) { if (appContext == null) { throw new ArgumentNullException("appContext"); } if (userMembershipProvider == null) { throw new ArgumentNullException("userMembershipProvider"); } //Configure Umbraco user manager to be created per request app.CreatePerOwinContext <BackOfficeUserManager>( (options, owinContext) => BackOfficeUserManager.Create( options, appContext.Services.UserService, appContext.Services.EntityService, appContext.Services.ExternalLoginService, userMembershipProvider, UmbracoConfig.For.UmbracoSettings().Content)); app.SetBackOfficeUserManagerType <BackOfficeUserManager, BackOfficeIdentityUser>(); //Create a sign in manager per request app.CreatePerOwinContext <BackOfficeSignInManager>((options, context) => BackOfficeSignInManager.Create(options, context, app.CreateLogger <BackOfficeSignInManager>())); }
/// <summary> /// Configure a custom BackOfficeUserManager for Umbraco /// </summary> /// <param name="app"></param> /// <param name="appContext"></param> /// <param name="userManager"></param> public static void ConfigureUserManagerForUmbracoBackOffice <TManager, TUser>(this IAppBuilder app, ApplicationContext appContext, Func <IdentityFactoryOptions <TManager>, IOwinContext, TManager> userManager) where TManager : BackOfficeUserManager <TUser> where TUser : BackOfficeIdentityUser { if (appContext == null) { throw new ArgumentNullException("appContext"); } if (userManager == null) { throw new ArgumentNullException("userManager"); } //Configure Umbraco user manager to be created per request app.CreatePerOwinContext <TManager>(userManager); //Create a sign in manager per request app.CreatePerOwinContext <BackOfficeSignInManager>((options, context) => BackOfficeSignInManager.Create(options, context, app.CreateLogger(typeof(BackOfficeSignInManager).FullName))); }
public BackOfficeSecurityStampValidator( IOptions <BackOfficeSecurityStampValidatorOptions> options, BackOfficeSignInManager signInManager, ISystemClock clock, ILoggerFactory logger) : base(options, signInManager, clock, logger) { }