Package net.maploop.api
Class TwoFactorAPI
- java.lang.Object
-
- net.maploop.api.TwoFactorAPI
-
public class TwoFactorAPI extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description TwoFactorAPI()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isValidKey(java.lang.String secret, int code)
Check if a 6-digit code is a valid 2FA keystatic boolean
isValidKey(java.lang.String secret, java.lang.String code)
Check if a 6-digit code is a valid 2FA key
-
-
-
Method Detail
-
isValidKey
public static boolean isValidKey(java.lang.String secret, int code)
Check if a 6-digit code is a valid 2FA key- Parameters:
secret
- The secret key unique to the usercode
- The 6-digit code that was provided- Returns:
- If the 6-digit code provided is a valid 2FA key
-
isValidKey
public static boolean isValidKey(java.lang.String secret, java.lang.String code) throws ValidationException
Check if a 6-digit code is a valid 2FA key- Parameters:
secret
- The secret key unique to the usercode
- The 6-digit code that was provided- Returns:
- If the 6-digit code provided is a valid 2FA key
- Throws:
ValidationException
- If the string code provided cannot be parsed as an integer
-
-