尝试在脉冲星流本机集群中进行 oauth 时出现错误 404

error 404 when try to make oauth in pulsar stream native cluster

你好,我正在尝试使用本机流连接到 Apache Pulsar 集群,我在令牌 Oauth 方面没有问题,但是当我尝试创建 Oauth 时,我总是收到格式错误的响应或 404 我正在使用 curl 和 python 客户,并按照他们的指示,像这样。

params = '''
{
    "issuer_url": "https://auth.streamnative.cloud/",
    "private_key": test.json",
    "audience": "urn:sn:pulsar:test:test"
}
'''

pulsar_client = pulsar.Client(
    PULSAR_URL,
    authentication=AuthenticationOauth2(params)
)

错误如下:

AuthOauth2:223 | Response failed for getting the well-known configuration https://auth.streamnative.cloud/. response Code 404

但是参数和 url 我从 https://console.streamnative.cloud/test/test/clients 得到,但什么都没有。

关于如何使用 oauth 连接到集群的任何想法?

编辑

对于客户端,凭据有效,看起来像是 python pulsar 2.9.1 包中的错误。

谢谢

您可能需要私钥的完整路径。确保它有权限。

还要确保您的听众是正确的

什么是 pulsar URL 格式?

pulsar+ssl://sn-myinstance.mycluster.snio.cloud:6651 

我这里有一个示例 python 应用程序

https://github.com/tspannhw/FLiP-Pi-BreakoutGarden/blob/c056b0eccc7ad18f8b18740bb30c224467991310/consume.sh

client = pulsar.Client(args.service_url, authentication=AuthenticationOauth2(args.auth_params))

https://docs.streamnative.io/cloud/stable/connect/client/connect-python

https://github.com/streamnative/examples/blob/master/cloud/README.md

还要确保您提供了与您的密钥权限关联的用户 ID。

如果这不起作用,请在 Pulsar slack 上与我聊天。