Class OtpServiceImpl
- java.lang.Object
-
- org.molgenis.security.twofactor.service.OtpServiceImpl
-
- All Implemented Interfaces:
OtpService
@Service public class OtpServiceImpl extends Object implements OtpService
-
-
Constructor Summary
Constructors Constructor Description OtpServiceImpl(org.molgenis.settings.AppSettings appSettings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAuthenticatorURI(String secretKey)Generate URI for use in authenticator appsbooleantryVerificationCode(String verificationCode, String secretKey)Use TOTP algorithm to verify validity of secret and verification code.
-
-
-
Method Detail
-
tryVerificationCode
public boolean tryVerificationCode(String verificationCode, String secretKey)
Description copied from interface:OtpServiceUse TOTP algorithm to verify validity of secret and verification code.- Specified by:
tryVerificationCodein interfaceOtpService- Parameters:
verificationCode- given verificationCodesecretKey- generated secret key- Returns:
- vericifcationCode matches secret key
-
getAuthenticatorURI
public String getAuthenticatorURI(String secretKey)
Description copied from interface:OtpServiceGenerate URI for use in authenticator apps- Specified by:
getAuthenticatorURIin interfaceOtpService- Returns:
- Google Authenticator URI
-
-