Class OtpServiceImpl
- java.lang.Object
-
- org.molgenis.security.twofactor.service.OtpServiceImpl
-
- All Implemented Interfaces:
OtpService
@Service public class OtpServiceImpl extends java.lang.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 java.lang.StringgetAuthenticatorURI(java.lang.String secretKey)Generate URI for use in authenticator appsbooleantryVerificationCode(java.lang.String verificationCode, java.lang.String secretKey)Use TOTP algorithm to verify validity of secret and verification code.
-
-
-
Method Detail
-
tryVerificationCode
public boolean tryVerificationCode(java.lang.String verificationCode, java.lang.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 java.lang.String getAuthenticatorURI(java.lang.String secretKey)
Description copied from interface:OtpServiceGenerate URI for use in authenticator apps- Specified by:
getAuthenticatorURIin interfaceOtpService- Returns:
- Google Authenticator URI
-
-