Package org.compiere.model
Interface IMFAMechanism
public interface IMFAMechanism
Interface for multi-factor authentication
-
Method Summary
Modifier and TypeMethodDescriptioncomplete
(Properties ctx, MMFARegistration reg, String code, String name, boolean preferred, String trxName) Complete/Validate a previous registration.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.validateCode
(MMFARegistration reg, String code, boolean setPreferred) Validate a code
-
Method Details
-
register
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 valid.- 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
Generate a validation code (when needed depending on the method)- Parameters:
reg
-- Returns:
- validation code
-
validateCode
Validate a code- Parameters:
reg
-code
-setPreferred
-- Returns:
- message on error, null when OK
-