Poco::OSP::Auth::TwoFactor

class TwoFactorServiceImpl

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 virtual

~TwoFactorServiceImpl();

Destroys the TwoFactorServiceImpl.

Member Functions

disable2FA virtual

void disable2FA(
    const std::string & username
);

enable2FA virtual

void enable2FA(
    const std::string & username
);

generateAuthenticatorURI virtual

std::string generateAuthenticatorURI(
    const std::string & username
) const;

is2FAEnabled virtual

bool is2FAEnabled(
    const std::string & username
) const;

isA virtual

bool isA(
    const std::type_info & otherType
) const;

secret virtual

std::string secret(
    const std::string & username
) const;

type virtual

const std::type_info & type() const;

validateTOTP virtual

ValidationResult validateTOTP(
    const std::string & username,
    const std::string & totp
);

generateKey protected

Poco::Crypto::CipherKey generateKey() const;

loadSecret protected

std::string loadSecret(
    const std::string & username
) const;

storeSecret protected

void storeSecret(
    const std::string & username,
    const std::string & secret
);

Variables

ATTR_LAST_TOTP protected static

static const std::string ATTR_LAST_TOTP;

ATTR_SECRET protected static

static const std::string ATTR_SECRET;

SALT protected static

static const std::string SALT;

Securely control IoT edge devices from anywhere   Connect a Device