@Service public class TwoFactorAuthenticationServiceImpl extends Object implements TwoFactorAuthenticationService
| Constructor and Description |
|---|
TwoFactorAuthenticationServiceImpl(OtpService otpService,
DataService dataService,
UserService userService,
IdGenerator idGenerator,
UserSecretFactory userSecretFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
disableForUser()
Disable 2 factor authentication for the current user
|
void |
enableForUser() |
String |
generateSecretKey() |
boolean |
isConfiguredForUser()
Check if the user is 2 factor authentication ready.
|
boolean |
isVerificationCodeValidForUser(String verificationCode)
Check verificationcode given by user from Google Authenticator
|
void |
resetSecretForUser() |
void |
saveSecretForUser(String secret)
Add generated userSecret to userdata.
|
boolean |
userIsBlocked() |
public TwoFactorAuthenticationServiceImpl(OtpService otpService, DataService dataService, UserService userService, IdGenerator idGenerator, UserSecretFactory userSecretFactory)
public boolean isVerificationCodeValidForUser(String verificationCode)
TwoFactorAuthenticationServiceisVerificationCodeValidForUser in interface TwoFactorAuthenticationServiceverificationCode - code given by user from Google Authenticatorpublic boolean userIsBlocked()
userIsBlocked in interface TwoFactorAuthenticationServicepublic void saveSecretForUser(String secret)
TwoFactorAuthenticationServicesaveSecretForUser in interface TwoFactorAuthenticationServicesecret - given secret for userpublic void resetSecretForUser()
resetSecretForUser in interface TwoFactorAuthenticationServicepublic void enableForUser()
enableForUser in interface TwoFactorAuthenticationServicepublic void disableForUser()
TwoFactorAuthenticationServiceRemoves the secret key and set the TwoFactorAuthentication field to false
disableForUser in interface TwoFactorAuthenticationServicepublic String generateSecretKey()
generateSecretKey in interface TwoFactorAuthenticationServicepublic boolean isConfiguredForUser()
TwoFactorAuthenticationServiceisConfiguredForUser in interface TwoFactorAuthenticationServiceCopyright © 2019 Pivotal Software, Inc.. All rights reserved.