Skip to content
This repository has been archived by the owner on Dec 14, 2017. It is now read-only.

Commit

Permalink
Merge pull request #402 from rallman/master
Browse files Browse the repository at this point in the history
Expose VerificationKeyStaleDurationMinutes to web.config
  • Loading branch information
brockallen committed Jul 25, 2014
2 parents beb6960 + a5f135f commit 8ece291
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1965,7 +1965,7 @@ protected virtual bool IsVerificationKeyStale(TAccount account)
return true;
}

if (account.VerificationKeySent < UtcNow.AddMinutes(-MembershipRebootConstants.UserAccount.VerificationKeyStaleDurationMinutes))
if (account.VerificationKeySent < UtcNow.AddMinutes(-Configuration.VerificationKeyStaleDurationMinutes))
{
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public MembershipRebootConfiguration(SecuritySettings securitySettings)
this.AllowAccountDeletion = securitySettings.AllowAccountDeletion;
this.PasswordHashingIterationCount = securitySettings.PasswordHashingIterationCount;
this.PasswordResetFrequency = securitySettings.PasswordResetFrequency;
this.VerificationKeyStaleDurationMinutes = securitySettings.VerificationKeyStaleDurationMinutes;

this.Crypto = new DefaultCrypto();
}
Expand All @@ -45,6 +46,7 @@ public MembershipRebootConfiguration(SecuritySettings securitySettings)
public bool AllowAccountDeletion { get; set; }
public int PasswordHashingIterationCount { get; set; }
public int PasswordResetFrequency { get; set; }
public int VerificationKeyStaleDurationMinutes { get; set; }

AggregateValidator<TAccount> usernameValidators = new AggregateValidator<TAccount>();
public void RegisterUsernameValidator(params IValidator<TAccount>[] items)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ static SecuritySettings GetConfigSection()
private const string ALLOWACCOUNTDELETION = "allowAccountDeletion";
private const string PASSWORDHASHINGITERATIONCOUNT = "passwordHashingIterationCount";
private const string PASSWORDRESETFREQUENCY = "passwordResetFrequency";
private const string VERIFICATIONKEYSTALEDURATIONMINUTES = "verificationKeyStaleDurationMinutes";

[ConfigurationProperty(MULTITENANT, DefaultValue = MembershipRebootConstants.SecuritySettingDefaults.MultiTenant)]
public bool MultiTenant
Expand Down Expand Up @@ -128,5 +129,12 @@ public int PasswordResetFrequency
get { return (int)this[PASSWORDRESETFREQUENCY]; }
set { this[PASSWORDRESETFREQUENCY] = value; }
}

[ConfigurationProperty(VERIFICATIONKEYSTALEDURATIONMINUTES, DefaultValue = MembershipRebootConstants.UserAccount.VerificationKeyStaleDurationMinutes)]
public int VerificationKeyStaleDurationMinutes
{
get { return (int)this[VERIFICATIONKEYSTALEDURATIONMINUTES]; }
set { this[VERIFICATIONKEYSTALEDURATIONMINUTES] = value; }
}
}
}

0 comments on commit 8ece291

Please # to comment.