OAuth2.0 signature validation failing for HS256 algorithm with base64 encoded symmetric key #3368
Replies: 2 comments 2 replies
-
I will convert this issue to a GitHub discussion. Currently GitHub will automatically close and lock the issue even though your question will be transferred and responded to elsewhere. This is to let you know that we do not intend to ignore this but this is how the current GitHub conversion mechanism makes it seem for the users :( |
Beta Was this translation helpful? Give feedback.
-
There is no dedicated documentation for that combination. You may be the only user of that combination of tools/algos/settings, so it's on you to troubleshoot. Enabling debug logging may reveal relevant information. Erlang and OpenSSL (since they together implements TLS and crypto modules used by RabbitMQ) version information is also essential. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We are trying to use rabbitmq with oauth2 plugin (HS256 + base64url-encoded key value). We are using keycloak as the authentication server. Facing below error while trying to curl api/vhosts with port 15672.
Rabbitmq server-logs
2021-09-06 08:07:14.980 [debug] <0.983.0> Authentication using an OAuth 2/JWT token failed: signature_invalid 2021-09-06 08:07:14.981 [debug] <0.983.0> User '' failed authenticatation by backend rabbit_auth_backend_oauth2 2021-09-06 08:07:14.981 [debug] <0.983.0> User '' failed authenticatation by backend rabbit_auth_backend_internal 2021-09-06 08:07:14.981 [warning] <0.983.0> HTTP access denied: user '' - invalid credentials
advanced.config
[ {rabbit, [ {default_user, <<"user">>}, {default_pass, {encrypted, <<"5239e2VE3SiHKzRFnToP7li34XXPmCJt1aCX95noE/pxOqFUANEh4Iv0NlOIbptu">> } }, {config_entry_decoder, [ {passphrase, <<"mypassphrase">>} ]} ,{auth_backends, [rabbit_auth_backend_oauth2, rabbit_auth_backend_internal]} ]}, %%{foo, %% [{bar, [ {path, "/rabbitmq"}, %% {connections_total_enabled, true} ]} ]}, {rabbitmq_management, [ {listener, [{port, 15672} ]} ]}, {rabbitmq_auth_backend_oauth2, [ {resource_server_id, <<"rabbitmq">>}, {key_config, [ {default_key, <<"5635a0fd-b729-414d-b429-0aeb71abed13">>}, {signing_keys, #{ <<"5635a0fd-b729-414d-b429-0aeb71abed13">> => {map, #{ <<"alg">> => <<"HS256">>, <<"value">> => <<"XXXXXXXXx_S7ZeT91_G9QOjPWcHDQgJhaXXXXXXX7NxHA-l6U6WS42k-QacXXN1Eg">>, <<"kty">> => <<"MAC">>} } }} ]} ]} ].
NOTE: The same is working with keycloak + RS256 algorithm. Can anyone point the issue or provide the link to the documentation for configuring the HS256 with a key from keycloak.
Beta Was this translation helpful? Give feedback.
All reactions