nats-io / nats.py

Python3 client for NATS
https://nats-io.github.io/nats.py/
Apache License 2.0
885 stars 188 forks source link

Auth Code Authentication #37

Closed mfdeux closed 7 years ago

mfdeux commented 7 years ago

Will auth code authentication be included? Authenticating with token in connection string (i.e. "nats://TOKEN@localhost:4222") passes in the token as username server side. Changing to "nats://:TOKEN@localhost:4222" passes the token in as password, but still does not work.

wallyqs commented 7 years ago

Sorry, looks like it is missing so need to add it... https://github.com/nats-io/asyncio-nats/blob/master/nats/aio/client.py#L684-L695 You're right that it should be picking up the token from the passed username and sending auth_token as part of the CONNECT payload.

shiundu commented 7 years ago

@wallyqs Ah, you were already on it.

shiundu commented 7 years ago

Thanks, works like a charm!