diff options
| author | Grant Limberg <[email protected]> | 2021-06-04 16:29:03 -0700 |
|---|---|---|
| committer | Grant Limberg <[email protected]> | 2021-06-04 16:29:03 -0700 |
| commit | e6b4fb5af7c4f2220824ebfa67d253deb51c4073 (patch) | |
| tree | 689d04cf34f083320574030be7ac59d58afd4ce9 /controller/PostgreSQL.cpp | |
| parent | c227330d090ead1b106e7f5db3393417c97d56eb (diff) | |
add "ssoRedirectURL" to local.conf
plumbed it through to the central controller code
Diffstat (limited to 'controller/PostgreSQL.cpp')
| -rw-r--r-- | controller/PostgreSQL.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/controller/PostgreSQL.cpp b/controller/PostgreSQL.cpp index 271916be..86a3a688 100644 --- a/controller/PostgreSQL.cpp +++ b/controller/PostgreSQL.cpp @@ -309,7 +309,7 @@ void PostgreSQL::nodeIsOnline(const uint64_t networkId, const uint64_t memberId, } } -std::string PostgreSQL::getSSOAuthURL(const nlohmann::json &member) +std::string PostgreSQL::getSSOAuthURL(const nlohmann::json &member, const std::string &redirectURL) { // NONCE is just a random character string. no semantic meaning // state = HMAC SHA384 of Nonce based on shared sso key @@ -387,11 +387,10 @@ std::string PostgreSQL::getSSOAuthURL(const nlohmann::json &member) char state_hex[256]; Utils::hex(state, 48, state_hex); - const char *redirect_url = "https%3A%2F%2Fmy.zerotier.com%2Fapi%2Fnetwork%2Fsso-auth"; // TODO: this should be configurable OSUtils::ztsnprintf(authenticationURL, sizeof(authenticationURL), "%s?response_type=id_token&response_mode=form_post&scope=openid+email+profile&redriect_uri=%s&nonce=%s&state=%s&client_id=%s", authorization_endpoint.c_str(), - redirect_url, + redirectURL.c_str(), nonce.c_str(), state_hex, client_id.c_str()); |
