Skip to content

[Bug Report] OAuth doesn't work with 3.0.0 #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
teonsean-dm opened this issue Feb 1, 2023 · 2 comments
Closed

[Bug Report] OAuth doesn't work with 3.0.0 #88

teonsean-dm opened this issue Feb 1, 2023 · 2 comments

Comments

@teonsean-dm
Copy link

Using Python & OAuth.

if __name__ == "__main__":
    if len(sys.argv) != 5:
        print("Please provide message id.")
        exit(1)

    client = pulsar.Client(
        pulsar_url,
        authentication=pulsar.AuthenticationOauth2(pulsar_oauth_params),
    )
    reader = (
        client.create_reader(
            pulsar_topic,
            _pulsar.MessageId(
                int(sys.argv[3]), int(sys.argv[1]), int(sys.argv[2]),
                int(sys.argv[4])
            ),
        ),
    )[0]
    msg = reader.read_next()
    print(msg.message_id())
    print(msg.data().decode())

The same values of pulsar_url, pulsar_oauth_params and pulsar_topic works fine in 2.10.1, but fails in 3.0.0:

Traceback (most recent call last):
  File "./dm/clients/pulsar/message_reader.py", line 25, in <module>
    client.create_reader(
  File "/home/teonsean/Code/CorePython/venv/lib/python3.8/site-packages/pulsar/__init__.py", line 906, in create_reader
    c._reader = self._client.create_reader(topic, start_message_id, conf)
_pulsar.AuthenticationError: Pulsar error: AuthenticationError
@BewareMyPower
Copy link
Contributor

I have encountered a similar error, see apache/pulsar-client-cpp#184

I'm investigating it currently. One workaround might be building from source.

git clone [email protected]:apache/pulsar-client-python.git -b v3.1.0-candidate-1
git submodule update --init
cmake -B build
cmake --build build
cp build/lib_pulsar.so .
python3 ./setup.py bdist_wheel
sudo pip3 install dist/pulsar_client-3.1.0a1-cp38-cp38-linux_x86_64.whl --force-reinstall

The commands above are pasted from the original comment.

@BewareMyPower
Copy link
Contributor

It should be fixed in 3.1.0. Please open another issue if you still encountered the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants