AMQP: 0-9-1: OAuth2 Token Size Limitation Causes Connection Failure (frame_too_large) #13537
-
Describe the bugWhen using OAuth2 authentication with RabbitMQ, if the access token is too large, the connection fails with the following error:
and
Reducing the token size resolves the issue, which suggests that RabbitMQ has a hard limit on OAuth2 token length that is causing an authentication failure. Environment Suggested Fix Reproduction stepsCreate a token that is too largeConfigure RabbitMQ OAuth2 authentication. Expected behaviorRabbitMQ should either: Additional contextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 18 replies
-
@psavva RabbitMQ 3.13 is out of community support. There is no such thing as an "AMQP 0-9-1 token" and "a token that is too large" is not a reproduction step. We will not guess how long is "too long". What is really going on in your case: AMQP 0-9-1 has a limit on the length of the password field (likely of 255 bytes but it's been a long time since I've looked at that part of the codebase), so Such validation belongs to client libraries. You are welcome to contribute it to the .NET client, and more specifically to its |
Beta Was this translation helpful? Give feedback.
-
Instead of calling up your colleagues @constantinos-yiasemi @chriscosta @icanci01 to an upvote fest, you'd be better off explaining what tooling produces those large JWT tokens and in what circumstances. A very rare to see issue (in the few years that the OAuth 2 support it's been available) suddenly attracts a few upvotes in just nine hours. Seems legit 🤣 We support and test against five different IDPs and there are users who have adopted OAuth 2 at a very large scale with multiple IDPs, and yet somehow they do not run into this password field length limitation. |
Beta Was this translation helpful? Give feedback.
-
@psavva @chriscosta the Your clients or Which might explain why there were only two reports of JWT tokens running over the limit in a few years of OAuth 2 support. See |
Beta Was this translation helpful? Give feedback.
-
A higher pre-authentication frame max default will ship in It can in theory affect some clients with exotic configurations, so it won't be backported to Starting with This is now documented in the Troubleshooting OAuth 2 guide. amqplib Users Will Have to Upgrade Their Client LibraryJavaScript's |
Beta Was this translation helpful? Give feedback.
A higher pre-authentication frame max default will ship in
4.1.0
: #13542, #13549, 18533d4.It can in theory affect some clients with exotic configurations, so it won't be backported to
4.0.x
, at least that's the decision for now.Starting with
4.0.0
, the initial frame size limit can be configured, including viarabbitmq.conf
(even though the setting is fairly advanced).This is now documented in the Troubleshooting OAuth 2 guide.
amqplib Users Will Have to Upgrade Their Client Library
JavaScript's
amqplib
users would have to upgrade to a new release when it comes out or that client won't be able to connect to a RabbitMQ4.1.0
node due to a very low initialframe_max
(set at least 10 years…