Table of Contents

Class LoginSecurityPolicy

Namespace
FishMMO.Server.Implementation
Assembly
FishMMO.Server.dll

The login server's closed-test (beta) and database-backed sign-in lockout settings, read from LoginServer.cfg. Shared by account creation and the SRP authenticator so the two can never disagree about whether the server is in a closed test or what a lockout is.

public static class LoginSecurityPolicy
Inheritance
LoginSecurityPolicy
Inherited Members

Remarks

The lockout defaults are the Control Panel's. Failures are counted on the account row, so every login server and the panel lock one account together; a login server configured differently from the panel would still share the counter but disagree about when it trips. Change them in both places or neither.

Read on every use rather than cached, like AccountVerificationPolicy: the parsing is a handful of dictionary lookups and a login is not a hot loop.

Fields

BetaModeKey

Key that turns closed-test mode on. Default false.

public const string BetaModeKey = "BetaMode"

Field Value

string

BetaProgramsKey

Key listing the beta programs, comma-separated.

public const string BetaProgramsKey = "BetaPrograms"

Field Value

string

DefaultPasswordLockMinutes

Shared default: locked for 15 minutes.

public const int DefaultPasswordLockMinutes = 15

Field Value

int

DefaultPasswordThreshold

Shared default: 5 password failures.

public const int DefaultPasswordThreshold = 5

Field Value

int

DefaultPasswordWindowMinutes

Shared default: counted over 15 minutes.

public const int DefaultPasswordWindowMinutes = 15

Field Value

int

DefaultTwoFactorLockMinutes

Shared default: locked for 30 minutes.

public const int DefaultTwoFactorLockMinutes = 30

Field Value

int

DefaultTwoFactorThreshold

Shared default: 5 wrong second-factor codes.

public const int DefaultTwoFactorThreshold = 5

Field Value

int

DefaultTwoFactorWindowMinutes

Shared default: counted over 15 minutes.

public const int DefaultTwoFactorWindowMinutes = 15

Field Value

int

PasswordLockMinutesKey

Minutes password sign-in stays locked.

public const string PasswordLockMinutesKey = "AuthLockoutPasswordLockMinutes"

Field Value

string

PasswordThresholdKey

Password failures that lock password sign-in.

public const string PasswordThresholdKey = "AuthLockoutPasswordThreshold"

Field Value

string

PasswordWindowMinutesKey

Minutes password failures are counted over.

public const string PasswordWindowMinutesKey = "AuthLockoutPasswordWindowMinutes"

Field Value

string

TwoFactorLockMinutesKey

Minutes the two-factor step stays locked.

public const string TwoFactorLockMinutesKey = "AuthLockoutTwoFactorLockMinutes"

Field Value

string

TwoFactorThresholdKey

Wrong second-factor codes that lock the two-factor step.

public const string TwoFactorThresholdKey = "AuthLockoutTwoFactorThreshold"

Field Value

string

TwoFactorWindowMinutesKey

Minutes second-factor failures are counted over.

public const string TwoFactorWindowMinutesKey = "AuthLockoutTwoFactorWindowMinutes"

Field Value

string

Methods

GetBetaPrograms(IServerConfiguration, out int)

The active beta programs: trimmed, lowercased, de-duplicated, invalid names dropped.

public static IReadOnlyList<string> GetBetaPrograms(IServerConfiguration configuration, out int rejected)

Parameters

configuration IServerConfiguration

Server configuration, or null.

rejected int

How many listed names were not valid program names.

Returns

IReadOnlyList<string>

GetPasswordLockout(IServerConfiguration)

The password-step lockout.

public static AuthLockoutSettings GetPasswordLockout(IServerConfiguration configuration)

Parameters

configuration IServerConfiguration

Returns

AuthLockoutSettings

GetTwoFactorLockout(IServerConfiguration)

The two-factor-step lockout.

public static AuthLockoutSettings GetTwoFactorLockout(IServerConfiguration configuration)

Parameters

configuration IServerConfiguration

Returns

AuthLockoutSettings

IsBetaModeEnabled(IServerConfiguration)

Whether the server is in a closed test. Anything but a readable true is off.

public static bool IsBetaModeEnabled(IServerConfiguration configuration)

Parameters

configuration IServerConfiguration

Returns

bool