@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)
TwoFactorAuthenticationServiceCheck verificationcode given by user from Google Authenticator
isVerificationCodeValidForUser in interface TwoFactorAuthenticationServiceverificationCode - code given by user from Google Authenticatorpublic boolean userIsBlocked()
userIsBlocked in interface TwoFactorAuthenticationServicepublic void saveSecretForUser(String secret)
TwoFactorAuthenticationServiceAdd generated userSecret to userdata.
saveSecretForUser in interface TwoFactorAuthenticationServicesecret - given secret for userpublic void resetSecretForUser()
resetSecretForUser in interface TwoFactorAuthenticationServicepublic void enableForUser()
enableForUser in interface TwoFactorAuthenticationServicepublic void disableForUser()
TwoFactorAuthenticationServiceDisable 2 factor authentication for the current user
Removes the secret key and set the TwoFactorAuthentication field to false
disableForUser in interface TwoFactorAuthenticationServicepublic String generateSecretKey()
generateSecretKey in interface TwoFactorAuthenticationServicepublic boolean isConfiguredForUser()
TwoFactorAuthenticationServiceCheck if the user is 2 factor authentication ready.
isConfiguredForUser in interface TwoFactorAuthenticationServiceCopyright © 2018 Pivotal Software, Inc.. All rights reserved.