public OpenAuthenticationService(IRepository<ExternalAuthenticationRecord> externalAuthenticationRecordRepository,
     IPluginFinder pluginFinder,
     ExternalAuthenticationSettings externalAuthenticationSettings)
 {
     this._externalAuthenticationRecordRepository = externalAuthenticationRecordRepository;
     this._pluginFinder = pluginFinder;
     this._externalAuthenticationSettings = externalAuthenticationSettings;
     //this._customerService = customerService;
 }
Пример #2
0
 public ExternalAuthorizer(IAuthenticationService authenticationService,
     IOpenAuthenticationService openAuthenticationService,
     IWorkContext workContext,
     ExternalAuthenticationSettings externalAuthenticationSettings,
     LocalizationSettings localizationSettings)
 {
     this._authenticationService = authenticationService;
     this._openAuthenticationService = openAuthenticationService;
     this._workContext = workContext;
     this._externalAuthenticationSettings = externalAuthenticationSettings;
     this._localizationSettings = localizationSettings;
 }
        public static bool IsMethodActive(this IExternalAuthenticationMethod method,
            ExternalAuthenticationSettings settings)
        {
            if (method == null)
                throw new ArgumentNullException("method");

            if (settings == null)
                throw new ArgumentNullException("settings");

            if (settings.ActiveAuthenticationMethodSystemNames == null)
                return false;
            foreach (string activeMethodSystemName in settings.ActiveAuthenticationMethodSystemNames)
                if (method.PluginDescriptor.SystemName.Equals(activeMethodSystemName, StringComparison.InvariantCultureIgnoreCase))
                    return true;
            return false;
        }