summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd.c
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2022-04-16 17:51:27 +0200
committerChristian Grothoff <grothoff@gnunet.org>2022-04-16 17:51:27 +0200
commitb496b8fed5bcef74e79bad7351cab98aae6a7dd7 (patch)
treef2e3139723a02a8f26b1d301dae326f75f36b764 /src/exchange/taler-exchange-httpd.c
parentfc1383ebd1cf2c57069422dc8a26d09f48869e10 (diff)
downloadexchange-b496b8fed5bcef74e79bad7351cab98aae6a7dd7.tar.gz
exchange-b496b8fed5bcef74e79bad7351cab98aae6a7dd7.tar.bz2
exchange-b496b8fed5bcef74e79bad7351cab98aae6a7dd7.zip
add more flexibility to endpoint naming for KYC
Diffstat (limited to 'src/exchange/taler-exchange-httpd.c')
-rw-r--r--src/exchange/taler-exchange-httpd.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c
index aa3a7c412..fb3129591 100644
--- a/src/exchange/taler-exchange-httpd.c
+++ b/src/exchange/taler-exchange-httpd.c
@@ -1413,12 +1413,12 @@ parse_kyc_oauth_cfg (void)
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (TEH_cfg,
"exchange-kyc-oauth2",
- "KYC_OAUTH2_URL",
+ "KYC_OAUTH2_AUTH_URL",
&s))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
"exchange-kyc-oauth2",
- "KYC_OAUTH2_URL");
+ "KYC_OAUTH2_AUTH_URL");
return GNUNET_SYSERR;
}
if ( (! TALER_url_valid_charset (s)) ||
@@ -1431,12 +1431,40 @@ parse_kyc_oauth_cfg (void)
{
GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
"exchange-kyc-oauth2",
- "KYC_OAUTH2_URL",
+ "KYC_OAUTH2_AUTH_URL",
"not a valid URL");
GNUNET_free (s);
return GNUNET_SYSERR;
}
- TEH_kyc_config.details.oauth2.url = s;
+ TEH_kyc_config.details.oauth2.auth_url = s;
+
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_string (TEH_cfg,
+ "exchange-kyc-oauth2",
+ "KYC_OAUTH2_LOGIN_URL",
+ &s))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ "exchange-kyc-oauth2",
+ "KYC_OAUTH2_LOGIN_URL");
+ return GNUNET_SYSERR;
+ }
+ if ( (! TALER_url_valid_charset (s)) ||
+ ( (0 != strncasecmp (s,
+ "http://",
+ strlen ("http://"))) &&
+ (0 != strncasecmp (s,
+ "https://",
+ strlen ("https://"))) ) )
+ {
+ GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
+ "exchange-kyc-oauth2",
+ "KYC_OAUTH2_LOGIN_URL",
+ "not a valid URL");
+ GNUNET_free (s);
+ return GNUNET_SYSERR;
+ }
+ TEH_kyc_config.details.oauth2.login_url = s;
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (TEH_cfg,