Adding Authenticator doc.

This commit is contained in:
stephb9959
2022-02-02 09:29:58 -08:00
parent ad38d8e84c
commit 3e0ecda9d6
3 changed files with 4 additions and 2 deletions

View File

@@ -234,6 +234,7 @@ namespace OpenWifi {
std::string Secret;
Existing.userTypeProprietaryInfo.mobiles.clear();
if(Existing.userTypeProprietaryInfo.authenticatorSecret.empty() && TotpCache()->CompleteValidation(UserInfo_.userinfo,false,Secret)) {
std::cout << "Secret:" << Secret << std::endl;
Existing.userTypeProprietaryInfo.authenticatorSecret = Secret;
} else if (!Existing.userTypeProprietaryInfo.authenticatorSecret.empty()) {
// we allow someone to use their old secret

View File

@@ -177,8 +177,8 @@ namespace OpenWifi::SecurityObjects {
bool UserLoginLoginExtensions::from_json(Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj,"mobiles",mobiles);
field_from_json(Obj,"mfa",mfa);
field_from_json(Obj, "mobiles",mobiles);
field_from_json(Obj, "mfa",mfa);
field_from_json(Obj, "authenticatorSecret", authenticatorSecret);
return true;
} catch (...) {

View File

@@ -151,6 +151,7 @@ namespace OpenWifi {
uint64_t Now = std::time(nullptr);
if(Hint!=Cache_.end() && Subscriber==Hint->second.Subscriber && (Now-Hint->second.Start)<(15*60) && Hint->second.Done!=0) {
Secret = Hint->second.Secret;
std::cout << "completed validation: " << Secret << std::endl;
Cache_.erase(Hint);
return true;
}