Package de.xima.fc.auth
Interface IMsUserAuthenticationService
-
public interface IMsUserAuthenticationServiceService interface for handling authentication-related operations on the master server.- Since:
- 8.4.0
- Author:
- Norman Lorenz
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<MfaTempTokenInfoDto>checkMfa(IUser user)Checks if two-factor authentication is required for the given user.booleanhasReachedMaxTokenLimit(IUser user)Returns whether the user has reached the maximum number of temporary MFA tokens allowed.booleanisMfaRequired(IUser user)Checks if two-factor authentication is required for the given user.MfaTempTokenInfoDtorefreshMfaTempToken(String token)MfaVerificationResultDtoverifyMfaCode(String code, String tempToken, boolean saveAuthentication)Verifies the provided MFA code against a temporary token.
-
-
-
Method Detail
-
checkMfa
Optional<MfaTempTokenInfoDto> checkMfa(IUser user) throws UserMfaTempTokenMaxException
Checks if two-factor authentication is required for the given user.- Parameters:
user- the user to check- Returns:
- an Optional containing a TwoFactorAuthenticationRequiredDto if two-factor authentication is required, or an empty Optional if it is not required
- Throws:
IllegalArgumentException- if the user is null or not authenticatedUserMfaTempTokenMaxException- if the maximum number of temporary tokens for two-factor authentication has been reached
-
verifyMfaCode
MfaVerificationResultDto verifyMfaCode(String code, String tempToken, boolean saveAuthentication) throws UserMfaTempTokenNotFoundException, UserMfaTempTokenMaxException, UserMfaTempTokenExpiredException
Verifies the provided MFA code against a temporary token.- Parameters:
code- the MFA code to verifytempToken- the temporary token associated with the MFA codesaveAuthentication- whether to save the authentication state if the code is valid- Returns:
- an MfaVerificationResultDto containing the result of the verification
- Throws:
UserMfaTempTokenNotFoundException- if the temporary token is not foundUserMfaTempTokenMaxException- if the maximum number of verification attempts for the temporary token has been reachedUserMfaTempTokenExpiredException- if the temporary token has expired
-
isMfaRequired
boolean isMfaRequired(IUser user)
Checks if two-factor authentication is required for the given user.- Parameters:
user- the user to check- Returns:
- true if two-factor authentication is required, false otherwise
- Throws:
IllegalArgumentException- if the user is null or not authenticated
-
hasReachedMaxTokenLimit
boolean hasReachedMaxTokenLimit(IUser user)
Returns whether the user has reached the maximum number of temporary MFA tokens allowed.- Parameters:
user- the user to check for maximum token limit- Returns:
- true if the user has reached the maximum token limit, false otherwise
- Throws:
IllegalArgumentException- if the user is null or does not have a profile
-
refreshMfaTempToken
MfaTempTokenInfoDto refreshMfaTempToken(String token) throws UserMfaTempTokenNotFoundException, UserMfaTempTokenMaxException, UserMfaTempTokenExpiredException
-
-