Package lumis.portal.authentication.mfa
Class MFAUtil
- java.lang.Object
-
- lumis.portal.authentication.mfa.MFAUtil
-
public class MFAUtil extends java.lang.Object
MFA utilities.- Since:
- 16.1.0
- Version:
- $Revision: 26156 $ $Date: 2024-01-13 10:26:46 -0300 (Sat, 13 Jan 2024) $
-
-
Constructor Summary
Constructors Constructor Description MFAUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
clearExpired()
Clears all expired tokens.static IMFATokenSendResult
sendMFATokenEmail(java.lang.String userLogin)
Sends an email with the MFA token.static void
sendTestMFAEmail(java.lang.String emailTemplateId, java.lang.String mfaServiceInstanceId)
Sends a test email with the MFA token.static boolean
validateMFAToken(java.lang.String userLogin, java.lang.String token)
Returns whether the given token is valid for the given user.
-
-
-
Method Detail
-
validateMFAToken
public static boolean validateMFAToken(java.lang.String userLogin, java.lang.String token) throws PortalException, java.lang.IllegalArgumentException
Returns whether the given token is valid for the given user.- Parameters:
userLogin
- the user logintoken
- the token- Returns:
- whether the given token is valid for the given user
- Throws:
java.lang.IllegalArgumentException
- if userLogin is null or emptyPortalException
- if some error occurs- Since:
- 16.1.0
-
sendMFATokenEmail
public static IMFATokenSendResult sendMFATokenEmail(java.lang.String userLogin) throws PortalException, java.lang.IllegalArgumentException, java.lang.IllegalStateException
Sends an email with the MFA token.- Parameters:
userLogin
- the user login- Returns:
- the created token result
- Throws:
java.lang.IllegalArgumentException
- if userLogin is null or emptyjava.lang.IllegalStateException
- if there's no mfa service instance configured globallyPortalException
- if some error occurs- Since:
- 16.1.0
-
sendTestMFAEmail
public static void sendTestMFAEmail(java.lang.String emailTemplateId, java.lang.String mfaServiceInstanceId) throws PortalException
Sends a test email with the MFA token.- Parameters:
emailTemplateId
- the email template idmfaServiceInstanceId
- the mfa service instance- Throws:
java.lang.IllegalArgumentException
- if emailTemplateId is null or emptyjava.lang.IllegalStateException
- if there's no mfa service instance configured globallyPortalException
- if some error occurs- Since:
- 16.1.0
-
clearExpired
public static void clearExpired()
Clears all expired tokens.- Since:
- 16.1.0
-
-