Class OTPAuthServiceImpl
- java.lang.Object
-
- io.mosip.authentication.common.service.impl.OTPAuthServiceImpl
-
- All Implemented Interfaces:
AuthService
,OTPAuthService
@Service public class OTPAuthServiceImpl extends Object implements OTPAuthService
Implementation for OTP Auth Service to authenticate OTP via OTP Manager.- Author:
- Dinesh Karuppiah.T
-
-
Constructor Summary
Constructors Constructor Description OTPAuthServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthStatusInfo
authenticate(AuthRequestDTO authRequestDTO, String uin, Map<String,List<IdentityInfoDTO>> idInfo, String partnerId)
Validates generated OTP via OTP Manager.Map<String,String>
getOtpKey(String uin, AuthRequestDTO authReq, String partnerId)
Gets the s pin.boolean
isEmpty(String otpVal)
Checks for Null or Empty.boolean
validateTxnAndIdvid(String txnId, String token, String idType)
Validates Transaction ID and Unique ID.
-
-
-
Method Detail
-
authenticate
public AuthStatusInfo authenticate(AuthRequestDTO authRequestDTO, String uin, Map<String,List<IdentityInfoDTO>> idInfo, String partnerId) throws IdAuthenticationBusinessException
Validates generated OTP via OTP Manager.- Specified by:
authenticate
in interfaceAuthService
- Parameters:
authRequestDTO
- the auth request DTOuin
- the ref ididInfo
- the id infopartnerId
- the partner id- Returns:
- true - when the OTP is Valid.
- Throws:
IdAuthenticationBusinessException
- the id authentication business exception
-
getOtpKey
public Map<String,String> getOtpKey(String uin, AuthRequestDTO authReq, String partnerId) throws IdAuthenticationBusinessException
Gets the s pin.- Parameters:
uin
- the uinauthReq
- the auth reqpartnerId
- the partner id- Returns:
- the s pin
- Throws:
IdAuthenticationBusinessException
- the id authentication business exception
-
validateTxnAndIdvid
public boolean validateTxnAndIdvid(String txnId, String token, String idType) throws IdAuthenticationBusinessException
Validates Transaction ID and Unique ID.- Parameters:
txnId
- the txn ididType
-idvid
- the idvid- Returns:
- true, if successful
- Throws:
IdAuthenticationBusinessException
- the id authentication business exception
-
isEmpty
public boolean isEmpty(String otpVal)
Checks for Null or Empty.- Parameters:
otpVal
- - OTP value- Returns:
- true - When the otpVal is Not null or empty
-
-