0

我将 xsolla webhooks 与 php sdk 一起使用,但我无法使用本地 webhooks 运行我的代码

我收到此错误:

"error": {
        "code": "INVALID_CLIENT_IP",
        "message": "Client IP address (127.0.0.1) not found in allowed IP addresses whitelist (159.255.220.240\/28, 185.30.20.16\/29, 185.30.21.0\/24, 185.30.21.16\/29). Please check troubleshooting section in README.md https:\/\/github.com\/xsolla\/xsolla-sdk-php#troubleshooting"
    }

我将 xsolla webhooks 与 php sdk 一起使用,但我无法使用本地 webhooks 运行我的代码

我收到此错误:

"error": {
        "code": "INVALID_CLIENT_IP",
        "message": "Client IP address (127.0.0.1) not found in allowed IP addresses whitelist (159.255.220.240\/28, 185.30.20.16\/29, 185.30.21.0\/24, 185.30.21.16\/29). Please check troubleshooting section in README.md https:\/\/github.com\/xsolla\/xsolla-sdk-php#troubleshooting"
    }

当我添加 IP 地址 127.0.01

像那样 :

protected static $xsollaSubnets = [
        '159.255.220.240/28',
        '185.30.20.16/29',
        '185.30.21.0/24',
        '127.0.0.1',
        '185.30.21.16/29',
    ];

它向我显示了另一个错误:

  "error": {
            "code": "INVALID_SIGNATURE",
            "message": "\"Authorization\" header not found in Xsolla webhook request. Please check troubleshooting section in README.md https:\/\/github.com\/xsolla\/xsolla-sdk-php#troubleshooting"
        }

任何人都可以帮忙吗?谢谢

4

1 回答 1

0

带有消息“在 Xsolla webhook 请求中找不到授权标头”的“INVALID_SIGNATURE”错误代码

Apache 下的 php-cgi 默认不传递 HTTP Basic 用户/传递给 PHP。

为了使它工作,您需要将以下行添加到 .htaccess 或 httpd.conf Apache 文件:

RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.+)$
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
于 2022-02-04T00:30:15.357 回答