File Information
Library: OSP/Auth/TwoFactor
Package: TwoFactor
Header: Poco/OSP/Auth/TwoFactor/TwoFactorServiceImpl.h
Description
Default implementation of the TwoFactorService.
Inheritance
Direct Base Classes: TwoFactorService
All Base Classes: TwoFactorService, Poco::OSP::Service, Poco::RefCountedObject
Member Summary
Member Functions: disable2FA, enable2FA, generateAuthenticatorURI, generateKey, is2FAEnabled, isA, loadSecret, secret, storeSecret, type, validateTOTP
Inherited Functions: disable2FA, duplicate, enable2FA, generateAuthenticatorURI, is2FAEnabled, isA, referenceCount, release, secret, type, validateTOTP
Nested Classes
struct Config
Types Aliases
Ptr
using Ptr = Poco::AutoPtr < TwoFactorServiceImpl >;
Constructors
TwoFactorServiceImpl
TwoFactorServiceImpl(
const AuthAdminService::Ptr pAuthService,
const Config & config
);
Creates the TwoFactorServiceImpl, using the given AuthAdminService and config.
Destructor
~TwoFactorServiceImpl
Destroys the TwoFactorServiceImpl.
Member Functions
disable2FA
void disable2FA(
const std::string & username
);
enable2FA
void enable2FA(
const std::string & username
);
generateAuthenticatorURI
std::string generateAuthenticatorURI(
const std::string & username
) const;
is2FAEnabled
bool is2FAEnabled(
const std::string & username
) const;
isA
bool isA(
const std::type_info & otherType
) const;
secret
std::string secret(
const std::string & username
) const;
type
const std::type_info & type() const;
validateTOTP
ValidationResult validateTOTP(
const std::string & username,
const std::string & totp
);
generateKey
Poco::Crypto::CipherKey generateKey() const;
loadSecret
std::string loadSecret(
const std::string & username
) const;
storeSecret
void storeSecret(
const std::string & username,
const std::string & secret
);
Variables
ATTR_LAST_TOTP
static const std::string ATTR_LAST_TOTP;
ATTR_SECRET
static const std::string ATTR_SECRET;
SALT
static const std::string SALT;