Class TwoFactorAuthenticator
- Assembly
- IpPbxCDSSharedLib.dll
public class TwoFactorAuthenticator
- Inheritance
-
TwoFactorAuthenticator
Constructors
TwoFactorAuthenticator()
public TwoFactorAuthenticator()
TwoFactorAuthenticator(bool, bool)
public TwoFactorAuthenticator(bool useManagedSha1, bool useUnmanagedOnFail)
Parameters
Fields
_epoch
public static DateTime _epoch
Field Value
Properties
DefaultClockDriftTolerance
public TimeSpan DefaultClockDriftTolerance { get; set; }
Property Value
TryUnmanagedAlgorithmOnFailure
public bool TryUnmanagedAlgorithmOnFailure { get; set; }
Property Value
UseManagedSha1Algorithm
public bool UseManagedSha1Algorithm { get; set; }
Property Value
Methods
GenerateSetupCode(string, string, int, int)
Generate a setup code for a Google Authenticator user to scan.
public SetupCode GenerateSetupCode(string accountTitleNoSpaces, string accountSecretKey, int qrCodeWidth, int qrCodeHeight)
Parameters
accountTitleNoSpacesstringAccount Title (no spaces)
accountSecretKeystringAccount Secret Key
qrCodeWidthintQR Code Width
qrCodeHeightintQR Code Height
Returns
- SetupCode
SetupCode object
GenerateSetupCode(string, string, string, int, int)
Generate a setup code for a Google Authenticator user to scan (with issuer ID).
public SetupCode GenerateSetupCode(string issuer, string accountTitleNoSpaces, string accountSecretKey, int qrCodeWidth, int qrCodeHeight)
Parameters
issuerstringIssuer ID (the name of the system, i.e. 'MyApp')
accountTitleNoSpacesstringAccount Title (no spaces)
accountSecretKeystringAccount Secret Key
qrCodeWidthintQR Code Width
qrCodeHeightintQR Code Height
Returns
- SetupCode
SetupCode object
GenerateSetupCode(string, string, string, int, int, bool)
Generate a setup code for a Google Authenticator user to scan (with issuer ID).
public SetupCode GenerateSetupCode(string issuer, string accountTitleNoSpaces, string accountSecretKey, int qrCodeWidth, int qrCodeHeight, bool useHttps)
Parameters
issuerstringIssuer ID (the name of the system, i.e. 'MyApp')
accountTitleNoSpacesstringAccount Title (no spaces)
accountSecretKeystringAccount Secret Key
qrCodeWidthintQR Code Width
qrCodeHeightintQR Code Height
useHttpsboolUse HTTPS instead of HTTP
Returns
- SetupCode
SetupCode object
GetCurrentPIN(string)
public string GetCurrentPIN(string accountSecretKey)
Parameters
accountSecretKeystring
Returns
GetCurrentPIN(string, DateTime)
public string GetCurrentPIN(string accountSecretKey, DateTime now)
Parameters
Returns
GetCurrentPINs(string)
public string[] GetCurrentPINs(string accountSecretKey)
Parameters
accountSecretKeystring
Returns
- string[]
GetCurrentPINs(string, TimeSpan)
public string[] GetCurrentPINs(string accountSecretKey, TimeSpan timeTolerance)
Parameters
Returns
- string[]
ValidateTwoFactorPIN(string, string)
public bool ValidateTwoFactorPIN(string accountSecretKey, string twoFactorCodeFromClient)
Parameters
Returns
ValidateTwoFactorPIN(string, string, TimeSpan)
public bool ValidateTwoFactorPIN(string accountSecretKey, string twoFactorCodeFromClient, TimeSpan timeTolerance)