public LdapRealm(Config config, SecurityLog securityLog, SecureHasher secureHasher) : base() { this._securityLog = securityLog; this._secureHasher = secureHasher; Name = SecuritySettings.LDAP_REALM_NAME; RolePermissionResolver = PredefinedRolesBuilder.RolePermissionResolver; ConfigureRealm(config); if (AuthenticationCachingEnabled) { CredentialsMatcher = secureHasher.HashedCredentialsMatcher; } else { CredentialsMatcher = new AllowAllCredentialsMatcher(); } }
internal InternalFlatFileRealm( UserRepository userRepository, RoleRepository roleRepository, PasswordPolicy passwordPolicy, AuthenticationStrategy authenticationStrategy, bool authenticationEnabled, bool authorizationEnabled, JobScheduler jobScheduler, UserRepository initialUserRepository, UserRepository defaultAdminRepository ) : base() { Name = SecuritySettings.NATIVE_REALM_NAME; this._userRepository = userRepository; this._roleRepository = roleRepository; this._initialUserRepository = initialUserRepository; this._defaultAdminRepository = defaultAdminRepository; this._passwordPolicy = passwordPolicy; this._authenticationStrategy = authenticationStrategy; this._authenticationEnabled = authenticationEnabled; this._authorizationEnabled = authorizationEnabled; this._jobScheduler = jobScheduler; AuthenticationCachingEnabled = false; // NOTE: If this is ever changed to true it is not secure to use // AllowAllCredentialsMatcher anymore AuthorizationCachingEnabled = false; CredentialsMatcher = new AllowAllCredentialsMatcher(); // Since we do not cache authentication info we can // disable the credentials matcher RolePermissionResolver = PredefinedRolesBuilder.RolePermissionResolver; }