OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Connect to amqp with jwt token

  • Thread starter Thread starter mxxnseat
  • Start date Start date
M

mxxnseat

Guest
I use @cloudamqp/amqp-client library and set up rabbitmq server to use oauth2, how can I use jwt to connect to broker via websocket?

I tried make this - connection closed: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile., but obviously it doesn't work

Code:
const amqp = new AMQPWebSocketClient(
  "ws://localhost:15670?token=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjNRR0Q5eU9aREhyaFBKaTdjQkg5WSJ9.eyJpc3MiOiJodHRwczovL2Rldi0zN2l2aGxidDBhbjE3NHYyLnVzLmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHw2Njc2YmFiODYxYjI2MWY2NDNhNmQ2YjQiLCJhdWQiOlsiaHR0cHM6Ly9kZXYtMzdpdmhsYnQwYW4xNzR2Mi51cy5hdXRoMC5jb20vYXBpL3YyLyIsImh0dHBzOi8vZGV2LTM3aXZobGJ0MGFuMTc0djIudXMuYXV0aDAuY29tL3VzZXJpbmZvIl0sImlhdCI6MTcxOTA1NzA4NCwiZXhwIjoxNzE5MDY0Mjg0LCJzY29wZSI6Im9wZW5pZCBwcm9maWxlIGVtYWlsIiwiYXpwIjoiWjNEbTBRWXhlbDREYkJZQ0ZzUDdYQTBtaEg5MklHaHYifQ.FsDJhUZ0ybiIV8C1pAxn6eDwlVoq6rVYcU6JywSU7Lm4sELz2LffzxJzxN_gabJHSh1C49WG5yU1LvLSep448u6sz5b7W2OSsHaCznolhc5T2JvjrYybtxD1Vph_eU8Aozb1ScfV-hz6W2emRloKh9kVTWUUUTzlpB5lE_L3GiEQExU6XWJy_GRbJ5bBA15nQmunDmtT-gQYKcYn1FSdyPwThQN_rr7UkfgSG_Yg-gsYIkl-X-qvvpJ0EtRIEuMn-n_OTfzB5sQhu6t5BLOI55pvK8g9pjIVNSHJGeD9RcnivmPKNas24SoCrSxKQAwMimLIraedysHLnoLsn1LqEw"
);

@cloudamqp/amqp-client version is 3.1.1

<p>I use @cloudamqp/amqp-client library and set up rabbitmq server to use oauth2, how can I use jwt to connect to broker via websocket?</p>
<p>I tried make this - <code>connection closed: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.</code>, but obviously it doesn't work</p>
<pre><code>const amqp = new AMQPWebSocketClient(
"ws://localhost:15670?token=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjNRR0Q5eU9aREhyaFBKaTdjQkg5WSJ9.eyJpc3MiOiJodHRwczovL2Rldi0zN2l2aGxidDBhbjE3NHYyLnVzLmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHw2Njc2YmFiODYxYjI2MWY2NDNhNmQ2YjQiLCJhdWQiOlsiaHR0cHM6Ly9kZXYtMzdpdmhsYnQwYW4xNzR2Mi51cy5hdXRoMC5jb20vYXBpL3YyLyIsImh0dHBzOi8vZGV2LTM3aXZobGJ0MGFuMTc0djIudXMuYXV0aDAuY29tL3VzZXJpbmZvIl0sImlhdCI6MTcxOTA1NzA4NCwiZXhwIjoxNzE5MDY0Mjg0LCJzY29wZSI6Im9wZW5pZCBwcm9maWxlIGVtYWlsIiwiYXpwIjoiWjNEbTBRWXhlbDREYkJZQ0ZzUDdYQTBtaEg5MklHaHYifQ.FsDJhUZ0ybiIV8C1pAxn6eDwlVoq6rVYcU6JywSU7Lm4sELz2LffzxJzxN_gabJHSh1C49WG5yU1LvLSep448u6sz5b7W2OSsHaCznolhc5T2JvjrYybtxD1Vph_eU8Aozb1ScfV-hz6W2emRloKh9kVTWUUUTzlpB5lE_L3GiEQExU6XWJy_GRbJ5bBA15nQmunDmtT-gQYKcYn1FSdyPwThQN_rr7UkfgSG_Yg-gsYIkl-X-qvvpJ0EtRIEuMn-n_OTfzB5sQhu6t5BLOI55pvK8g9pjIVNSHJGeD9RcnivmPKNas24SoCrSxKQAwMimLIraedysHLnoLsn1LqEw"
);
</code></pre>
<p>@cloudamqp/amqp-client version is 3.1.1</p>
 

Latest posts

S
Replies
0
Views
1
Safwan Aipuram
S
Top