Ejemplo n.º 1
0
 public UserService(
     IAppConfiguration config,
     IEntityRepository<User> userRepository,
     IEntityRepository<Credential> credentialRepository,
     AuditingService auditing)
     : this()
 {
     Config = config;
     UserRepository = userRepository;
     CredentialRepository = credentialRepository;
     Auditing = auditing;
 }
Ejemplo n.º 2
0
        public AuthenticationService(IEntitiesContext entities, IAppConfiguration config, IDiagnosticsService diagnostics, AuditingService auditing, IEnumerable<Authenticator> providers)
        {
            _credentialFormatters = new Dictionary<string, Func<string, string>>(StringComparer.OrdinalIgnoreCase) {
                { "password", _ => Strings.CredentialType_Password },
                { "apikey", _ => Strings.CredentialType_ApiKey },
                { "external", FormatExternalCredentialType }
            };

            Entities = entities;
            Config = config;
            Auditing = auditing;
            Trace = diagnostics.SafeGetSource("AuthenticationService");
            Authenticators = providers.ToDictionary(p => p.Name, StringComparer.OrdinalIgnoreCase);
        }