public BackOfficeSignInManager( BackOfficeUserManager userManager, IHttpContextAccessor contextAccessor, IBackOfficeExternalLoginProviders externalLogins, IUserClaimsPrincipalFactory <BackOfficeIdentityUser> claimsFactory, IOptions <IdentityOptions> optionsAccessor, IOptions <GlobalSettings> globalSettings, ILogger <SignInManager <BackOfficeIdentityUser> > logger, IAuthenticationSchemeProvider schemes, IUserConfirmation <BackOfficeIdentityUser> confirmation) : this(userManager, contextAccessor, externalLogins, claimsFactory, optionsAccessor, globalSettings, logger, schemes, confirmation, StaticServiceProvider.Instance.GetRequiredService <IEventAggregator>()) { }
public UsersController( MediaFileManager mediaFileManager, IOptionsSnapshot <ContentSettings> contentSettings, IHostingEnvironment hostingEnvironment, ISqlContext sqlContext, IImageUrlGenerator imageUrlGenerator, IOptionsSnapshot <SecuritySettings> securitySettings, IEmailSender emailSender, IBackOfficeSecurityAccessor backofficeSecurityAccessor, AppCaches appCaches, IShortStringHelper shortStringHelper, IUserService userService, ILocalizedTextService localizedTextService, IUmbracoMapper umbracoMapper, IOptionsSnapshot <GlobalSettings> globalSettings, IBackOfficeUserManager backOfficeUserManager, ILoggerFactory loggerFactory, LinkGenerator linkGenerator, IBackOfficeExternalLoginProviders externalLogins, UserEditorAuthorizationHelper userEditorAuthorizationHelper, IPasswordChanger <BackOfficeIdentityUser> passwordChanger, IHttpContextAccessor httpContextAccessor, IOptions <WebRoutingSettings> webRoutingSettings) { _mediaFileManager = mediaFileManager; _contentSettings = contentSettings.Value; _hostingEnvironment = hostingEnvironment; _sqlContext = sqlContext; _imageUrlGenerator = imageUrlGenerator; _securitySettings = securitySettings.Value; _emailSender = emailSender; _backofficeSecurityAccessor = backofficeSecurityAccessor; _appCaches = appCaches; _shortStringHelper = shortStringHelper; _userService = userService; _localizedTextService = localizedTextService; _umbracoMapper = umbracoMapper; _globalSettings = globalSettings.Value; _userManager = backOfficeUserManager; _loggerFactory = loggerFactory; _linkGenerator = linkGenerator; _externalLogins = externalLogins; _userEditorAuthorizationHelper = userEditorAuthorizationHelper; _passwordChanger = passwordChanger; _logger = _loggerFactory.CreateLogger <UsersController>(); _httpContextAccessor = httpContextAccessor; _webRoutingSettings = webRoutingSettings.Value; }
public BackOfficeSignInManager( BackOfficeUserManager userManager, IHttpContextAccessor contextAccessor, IBackOfficeExternalLoginProviders externalLogins, IUserClaimsPrincipalFactory <BackOfficeIdentityUser> claimsFactory, IOptions <IdentityOptions> optionsAccessor, IOptions <GlobalSettings> globalSettings, ILogger <SignInManager <BackOfficeIdentityUser> > logger, IAuthenticationSchemeProvider schemes, IUserConfirmation <BackOfficeIdentityUser> confirmation) : base(userManager, contextAccessor, claimsFactory, optionsAccessor, logger, schemes, confirmation) { _userManager = userManager; _externalLogins = externalLogins; _globalSettings = globalSettings.Value; }
public BackOfficeServerVariables( LinkGenerator linkGenerator, IRuntimeState runtimeState, UmbracoFeatures features, IOptionsMonitor <GlobalSettings> globalSettings, IUmbracoVersion umbracoVersion, IOptionsMonitor <ContentSettings> contentSettings, IHttpContextAccessor httpContextAccessor, TreeCollection treeCollection, IHostingEnvironment hostingEnvironment, IOptionsMonitor <RuntimeSettings> runtimeSettings, IOptionsMonitor <SecuritySettings> securitySettings, IRuntimeMinifier runtimeMinifier, IBackOfficeExternalLoginProviders externalLogins, IImageUrlGenerator imageUrlGenerator, PreviewRoutes previewRoutes, IEmailSender emailSender, IOptionsMonitor <MemberPasswordConfigurationSettings> memberPasswordConfigurationSettings, IOptionsMonitor <DataTypesSettings> dataTypesSettings) { _linkGenerator = linkGenerator; _runtimeState = runtimeState; _features = features; _globalSettings = globalSettings.CurrentValue; _umbracoVersion = umbracoVersion; _contentSettings = contentSettings.CurrentValue ?? throw new ArgumentNullException(nameof(contentSettings)); _httpContextAccessor = httpContextAccessor; _treeCollection = treeCollection ?? throw new ArgumentNullException(nameof(treeCollection)); _hostingEnvironment = hostingEnvironment; _runtimeSettings = runtimeSettings.CurrentValue; _securitySettings = securitySettings.CurrentValue; _runtimeMinifier = runtimeMinifier; _externalLogins = externalLogins; _imageUrlGenerator = imageUrlGenerator; _previewRoutes = previewRoutes; _emailSender = emailSender; _memberPasswordConfigurationSettings = memberPasswordConfigurationSettings.CurrentValue; _dataTypesSettings = dataTypesSettings.CurrentValue; globalSettings.OnChange(x => _globalSettings = x); contentSettings.OnChange(x => _contentSettings = x); runtimeSettings.OnChange(x => _runtimeSettings = x); securitySettings.OnChange(x => _securitySettings = x); dataTypesSettings.OnChange(x => _dataTypesSettings = x); memberPasswordConfigurationSettings.OnChange(x => _memberPasswordConfigurationSettings = x); }
public UsersController( MediaFileManager mediaFileManager, IOptions <ContentSettings> contentSettings, IHostingEnvironment hostingEnvironment, ISqlContext sqlContext, IImageUrlGenerator imageUrlGenerator, IOptions <SecuritySettings> securitySettings, IEmailSender emailSender, IBackOfficeSecurityAccessor backofficeSecurityAccessor, AppCaches appCaches, IShortStringHelper shortStringHelper, IUserService userService, ILocalizedTextService localizedTextService, IUmbracoMapper umbracoMapper, IOptions <GlobalSettings> globalSettings, IBackOfficeUserManager backOfficeUserManager, ILoggerFactory loggerFactory, LinkGenerator linkGenerator, IBackOfficeExternalLoginProviders externalLogins, UserEditorAuthorizationHelper userEditorAuthorizationHelper, IPasswordChanger <BackOfficeIdentityUser> passwordChanger) : this(mediaFileManager, contentSettings, hostingEnvironment, sqlContext, imageUrlGenerator, securitySettings, emailSender, backofficeSecurityAccessor, appCaches, shortStringHelper, userService, localizedTextService, umbracoMapper, globalSettings, backOfficeUserManager, loggerFactory, linkGenerator, externalLogins, userEditorAuthorizationHelper, passwordChanger, StaticServiceProvider.Instance.GetRequiredService <IHttpContextAccessor>(), StaticServiceProvider.Instance.GetRequiredService <IOptions <WebRoutingSettings> >()) { }
/// <summary> /// Used to render the script that will pass in the angular "externalLoginInfo" service/value on page load /// </summary> /// <param name="html"></param> /// <param name="externalLogins"></param> /// <returns></returns> public static async Task <IHtmlContent> AngularValueExternalLoginInfoScriptAsync(this IHtmlHelper html, IBackOfficeExternalLoginProviders externalLogins, BackOfficeExternalLoginProviderErrors externalLoginErrors) { IEnumerable <BackOfficeExternaLoginProviderScheme> providers = await externalLogins.GetBackOfficeProvidersAsync(); var loginProviders = providers .Select(p => new { authType = p.ExternalLoginProvider.AuthenticationType, caption = p.AuthenticationScheme.DisplayName, properties = p.ExternalLoginProvider.Options }) .ToArray(); var sb = new StringBuilder(); sb.AppendLine(); sb.AppendLine(@"var errors = [];"); if (externalLoginErrors != null) { if (externalLoginErrors.Errors is not null) { foreach (var error in externalLoginErrors.Errors) { sb.AppendFormat(@"errors.push(""{0}"");", error.ToSingleLine()).AppendLine(); } } } sb.AppendLine(@"app.value(""externalLoginInfo"", {"); if (externalLoginErrors?.AuthenticationType != null) { sb.AppendLine($@"errorProvider: '{externalLoginErrors.AuthenticationType}',"); } sb.AppendLine(@"errors: errors,"); sb.Append(@"providers: "); sb.AppendLine(JsonConvert.SerializeObject(loginProviders)); sb.AppendLine(@"});"); return(html.Raw(sb.ToString())); }
public AuthenticationController( IBackOfficeSecurityAccessor backofficeSecurityAccessor, IBackOfficeUserManager backOfficeUserManager, IBackOfficeSignInManager signInManager, IUserService userService, ILocalizedTextService textService, IUmbracoMapper umbracoMapper, IOptionsSnapshot <GlobalSettings> globalSettings, IOptionsSnapshot <SecuritySettings> securitySettings, ILogger <AuthenticationController> logger, IIpResolver ipResolver, IOptionsSnapshot <UserPasswordConfigurationSettings> passwordConfiguration, IEmailSender emailSender, ISmsSender smsSender, IHostingEnvironment hostingEnvironment, LinkGenerator linkGenerator, IBackOfficeExternalLoginProviders externalAuthenticationOptions, IBackOfficeTwoFactorOptions backOfficeTwoFactorOptions, IHttpContextAccessor httpContextAccessor, IOptions <WebRoutingSettings> webRoutingSettings, ITwoFactorLoginService twoFactorLoginService) { _backofficeSecurityAccessor = backofficeSecurityAccessor; _userManager = backOfficeUserManager; _signInManager = signInManager; _userService = userService; _textService = textService; _umbracoMapper = umbracoMapper; _globalSettings = globalSettings.Value; _securitySettings = securitySettings.Value; _logger = logger; _ipResolver = ipResolver; _passwordConfiguration = passwordConfiguration.Value; _emailSender = emailSender; _smsSender = smsSender; _hostingEnvironment = hostingEnvironment; _linkGenerator = linkGenerator; _externalAuthenticationOptions = externalAuthenticationOptions; _backOfficeTwoFactorOptions = backOfficeTwoFactorOptions; _httpContextAccessor = httpContextAccessor; _webRoutingSettings = webRoutingSettings.Value; _twoFactorLoginService = twoFactorLoginService; }
public AuthenticationController( IBackOfficeSecurityAccessor backofficeSecurityAccessor, IBackOfficeUserManager backOfficeUserManager, IBackOfficeSignInManager signInManager, IUserService userService, ILocalizedTextService textService, IUmbracoMapper umbracoMapper, IOptions <GlobalSettings> globalSettings, IOptions <SecuritySettings> securitySettings, ILogger <AuthenticationController> logger, IIpResolver ipResolver, IOptions <UserPasswordConfigurationSettings> passwordConfiguration, IEmailSender emailSender, ISmsSender smsSender, IHostingEnvironment hostingEnvironment, LinkGenerator linkGenerator, IBackOfficeExternalLoginProviders externalAuthenticationOptions, IBackOfficeTwoFactorOptions backOfficeTwoFactorOptions, IHttpContextAccessor httpContextAccessor, IOptions <WebRoutingSettings> webRoutingSettings) : this( backofficeSecurityAccessor, backOfficeUserManager, signInManager, userService, textService, umbracoMapper, globalSettings, securitySettings, logger, ipResolver, passwordConfiguration, emailSender, smsSender, hostingEnvironment, linkGenerator, externalAuthenticationOptions, backOfficeTwoFactorOptions, StaticServiceProvider.Instance.GetRequiredService <IHttpContextAccessor>(), StaticServiceProvider.Instance.GetRequiredService <IOptions <WebRoutingSettings> >(), StaticServiceProvider.Instance.GetRequiredService <ITwoFactorLoginService>()) { }
public BackOfficeController( IBackOfficeUserManager userManager, IRuntimeState runtimeState, IRuntimeMinifier runtimeMinifier, IOptionsSnapshot <GlobalSettings> globalSettings, IHostingEnvironment hostingEnvironment, ILocalizedTextService textService, IGridConfig gridConfig, BackOfficeServerVariables backOfficeServerVariables, AppCaches appCaches, IBackOfficeSignInManager signInManager, IBackOfficeSecurityAccessor backofficeSecurityAccessor, ILogger <BackOfficeController> logger, IJsonSerializer jsonSerializer, IBackOfficeExternalLoginProviders externalLogins, IHttpContextAccessor httpContextAccessor, IBackOfficeTwoFactorOptions backOfficeTwoFactorOptions, IManifestParser manifestParser, ServerVariablesParser serverVariables, IOptions <SecuritySettings> securitySettings) { _userManager = userManager; _runtimeState = runtimeState; _runtimeMinifier = runtimeMinifier; _globalSettings = globalSettings.Value; _hostingEnvironment = hostingEnvironment; _textService = textService; _gridConfig = gridConfig ?? throw new ArgumentNullException(nameof(gridConfig)); _backOfficeServerVariables = backOfficeServerVariables; _appCaches = appCaches; _signInManager = signInManager; _backofficeSecurityAccessor = backofficeSecurityAccessor; _logger = logger; _jsonSerializer = jsonSerializer; _externalLogins = externalLogins; _httpContextAccessor = httpContextAccessor; _backOfficeTwoFactorOptions = backOfficeTwoFactorOptions; _manifestParser = manifestParser; _serverVariables = serverVariables; _securitySettings = securitySettings; }
public BackOfficeController( IBackOfficeUserManager userManager, IRuntimeState runtimeState, IRuntimeMinifier runtimeMinifier, IOptions <GlobalSettings> globalSettings, IHostingEnvironment hostingEnvironment, ILocalizedTextService textService, IGridConfig gridConfig, BackOfficeServerVariables backOfficeServerVariables, AppCaches appCaches, IBackOfficeSignInManager signInManager, IBackOfficeSecurityAccessor backofficeSecurityAccessor, ILogger <BackOfficeController> logger, IJsonSerializer jsonSerializer, IBackOfficeExternalLoginProviders externalLogins, IHttpContextAccessor httpContextAccessor, IBackOfficeTwoFactorOptions backOfficeTwoFactorOptions, IManifestParser manifestParser, ServerVariablesParser serverVariables) : this(userManager, runtimeState, runtimeMinifier, globalSettings, hostingEnvironment, textService, gridConfig, backOfficeServerVariables, appCaches, signInManager, backofficeSecurityAccessor, logger, jsonSerializer, externalLogins, httpContextAccessor, backOfficeTwoFactorOptions, manifestParser, serverVariables, StaticServiceProvider.Instance.GetRequiredService <IOptions <SecuritySettings> >() ) { }
public BackOfficeServerVariables( LinkGenerator linkGenerator, IRuntimeState runtimeState, UmbracoFeatures features, IOptionsMonitor <GlobalSettings> globalSettings, IUmbracoVersion umbracoVersion, IOptionsMonitor <ContentSettings> contentSettings, IHttpContextAccessor httpContextAccessor, TreeCollection treeCollection, IHostingEnvironment hostingEnvironment, IOptionsMonitor <RuntimeSettings> runtimeSettings, IOptionsMonitor <SecuritySettings> securitySettings, IRuntimeMinifier runtimeMinifier, IBackOfficeExternalLoginProviders externalLogins, IImageUrlGenerator imageUrlGenerator, PreviewRoutes previewRoutes, IEmailSender emailSender, IOptionsMonitor <MemberPasswordConfigurationSettings> memberPasswordConfigurationSettings) : this( linkGenerator, runtimeState, features, globalSettings, umbracoVersion, contentSettings, httpContextAccessor, treeCollection, hostingEnvironment, runtimeSettings, securitySettings, runtimeMinifier, externalLogins, imageUrlGenerator, previewRoutes, emailSender, memberPasswordConfigurationSettings, StaticServiceProvider.Instance.GetRequiredService <IOptionsMonitor <DataTypesSettings> >()) { }
/// <summary> /// Initializes a new instance of the <see cref="DenyLocalLoginHandler" /> class. /// </summary> /// <param name="externalLogins">Provides access to <see cref="BackOfficeExternalLoginProvider" /> instances.</param> public DenyLocalLoginHandler(IBackOfficeExternalLoginProviders externalLogins) => _externalLogins = externalLogins;