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

Commit

Permalink
chore(MembershipRebootConfiguration): obsolete AllowLoginAfterAccount…
Browse files Browse the repository at this point in the history
…Creation

If previously you set `AllowLoginAfterAccountCreation` to false, you
should instead:
* set `MembershipRebootConfiguration.RequireAccountApproval` to true
* replace the call to `UserAccountService.SetIsLoginAllowed` with
`UserAccountService.ApproveAccount` in order to allow login
  • Loading branch information
ccrowhurstram committed Sep 5, 2016
1 parent c018e42 commit 303e262
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,10 @@ protected void Init(TAccount account, string tenant, string username, string pas
account.AccountTwoFactorAuthMode = TwoFactorAuthMode.None;
account.CurrentTwoFactorAuthStatus = TwoFactorAuthMode.None;

// todo: once AllowLoginAfterAccountCreation has been removed use the commented out line of code instead
account.IsLoginAllowed = Configuration.AllowLoginAfterAccountCreation;
// account.IsLoginAllowed = true;

Tracing.Verbose("[UserAccountService.CreateAccount] SecuritySettings.AllowLoginAfterAccountCreation is set to: {0}", account.IsLoginAllowed);

string key = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public MembershipRebootConfiguration(SecuritySettings securitySettings)
public bool UsernamesUniqueAcrossTenants { get; set; }
public bool RequireAccountVerification { get; set; }
public bool RequireAccountApproval { get; set; }
[Obsolete(@"Use RequireAccountApproval instead and make calls to UserAccountService.ApproveAccount")]
public bool AllowLoginAfterAccountCreation { get; set; }
public int AccountLockoutFailedLoginAttempts { get; set; }
public TimeSpan AccountLockoutDuration { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ static SecuritySettings GetConfigSection()
private const string USERNAMESUNIQUEACROSSTENANTS = "usernamesUniqueAcrossTenants";
private const string REQUIREACCOUNTAPPROVAL = "requireAccountApproval";
private const string REQUIREACCOUNTVERIFICATION = "requireAccountVerification";
[Obsolete("Replaced by REQUIREACCOUNTAPPROVAL")]
private const string ALLOWLOGINAFTERACCOUNTCREATION = "allowLoginAfterAccountCreation";
private const string ACCOUNTLOCKOUTFAILEDLOGINATTEMPTS = "accountLockoutFailedLoginAttempts";
private const string ACCOUNTLOCKOUTDURATION = "accountLockoutDuration";
Expand Down Expand Up @@ -104,6 +105,7 @@ public bool RequireAccountApproval
set { this[REQUIREACCOUNTAPPROVAL] = value; }
}

[Obsolete("Replaced by RequireAccountApproval")]
[ConfigurationProperty(ALLOWLOGINAFTERACCOUNTCREATION, DefaultValue = MembershipRebootConstants.SecuritySettingDefaults.AllowLoginAfterAccountCreation)]
public bool AllowLoginAfterAccountCreation
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class SecuritySettingDefaults
internal const bool UsernamesUniqueAcrossTenants = false;
internal const bool RequireAccountVerification = true;
internal const bool RequireAccountApproval = false;
[Obsolete("Replaced by RequireAccountApproval")]
internal const bool AllowLoginAfterAccountCreation = true;
internal const int AccountLockoutFailedLoginAttempts = 5;
internal const string AccountLockoutDuration = "00:05:00";
Expand Down

0 comments on commit 303e262

Please sign in to comment.