add ssoEnabled flag to network config

This commit is contained in:
Grant Limberg 2021-06-05 13:44:45 -07:00
parent 9380ef708a
commit 364ad87e2b
No known key found for this signature in database
GPG key ID: 2BA62CCABBB4095A
8 changed files with 56 additions and 23 deletions

View file

@ -795,12 +795,12 @@ static int cli(int argc,char **argv)
OSUtils::jsonString(n["type"],"-").c_str(),
OSUtils::jsonString(n["portDeviceName"],"-").c_str(),
aa.c_str());
int64_t authenticationExpiryTime = n["authenticationExpiryTime"];
if (authenticationExpiryTime >= 0) {
if (OSUtils::jsonBool(n["ssoEnabled"], false)) {
uint64_t authenticationExpiryTime = n["authenticationExpiryTime"];
if (status == "AUTHENTICATION_REQUIRED") {
printf(" AUTH EXPIRED, URL: %s" ZT_EOL_S, OSUtils::jsonString(n["authenticationURL"], "(null)").c_str());
} else if (status == "OK") {
printf(" AUTH OK, expires in: %lld seconds" ZT_EOL_S, (authenticationExpiryTime - OSUtils::now()) / 1000LL);
printf(" AUTH OK, expires in: %lld seconds" ZT_EOL_S, ((int64_t)authenticationExpiryTime - OSUtils::now()) / 1000LL);
}
}
}