Package org.compiere.model
Interface IMFAMechanism
-
public interface IMFAMechanism
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
complete(Properties ctx, MMFARegistration reg, String code, String name, boolean preferred, String trxName)
Complete/Validate a previous registration Here it must check for validity of the mechanism, mark the record as valid or throw exception when notString
generateValidationCode(MMFARegistration reg)
Generate a validation code (when needed depending on the method)Object[]
register(Properties ctx, MMFAMethod method, String prm, String trxName)
Registration mechanism for the method Here the registration method executes the actions expected for this method, like sending an email, or an SMS, or nothing and creates the registration recordString
validateCode(MMFARegistration reg, String code, boolean setPreferred)
Validate a code
-
-
-
Method Detail
-
register
Object[] register(Properties ctx, MMFAMethod method, String prm, String trxName)
Registration mechanism for the method Here the registration method executes the actions expected for this method, like sending an email, or an SMS, or nothing and creates the registration record- Parameters:
ctx
-method
-prm
- optional, for example the emailtrxName
-- Returns:
- Object[] - first object is the String with the instructions to follow second object is the registration generated third and posterior objects are optional additional information for the method like QRCode image for example, or html img object, or URL, or File
-
complete
String complete(Properties ctx, MMFARegistration reg, String code, String name, boolean preferred, String trxName)
Complete/Validate a previous registration Here it must check for validity of the mechanism, mark the record as valid or throw exception when not- Parameters:
ctx
-reg
- The registration objectcode
- The code to be validatedname
- Optional - a name to assign the registrationpreferred
-trxName
-- Returns:
- msg A message indicating success, errors throw exception
-
generateValidationCode
String generateValidationCode(MMFARegistration reg)
Generate a validation code (when needed depending on the method)- Parameters:
reg
-- Returns:
-
validateCode
String validateCode(MMFARegistration reg, String code, boolean setPreferred)
Validate a code- Parameters:
reg
-code
-setPreferred
-- Returns:
- message on error, null when OK
-
-