Hello,
I want to thank you for your prompt feedback
I have followed another thread, I found yesterday and I change my config file as below
[
{
rabbit,
[
{auth_backends, [rabbit_auth_backend_oauth2]}
]
},
{
rabbitmq_management,
[
{oauth_enabled, true},
{oauth_client_id, "0oa9efwnr2Zl2Dqt35d7"},
{oauth_provider_url, "
https://dev-xxxxxx.okta.com/oauth2/default"},
{oauth_scopes, "openid"}
]
},
{
rabbitmq_auth_backend_oauth2,
[
{resource_server_id, <<"Client_id_okta">>},
{scope_aliases, #{
<<"openid">> => [
<<"Client_id_okta.read:*/*">>,
<<"Client_id_okta.write:*/*">>,
<<"Client_id_okta.configure:*/*">>
]
}
},
{key_config,
[
{jwks_url, <<"
https://dev-xxxxx.okta.com/oauth2/default/v1/keys">>}
]}
]}
].
Below screen of token from
jwt.io
In rabbitMQ server, I have below errors:
2023-05-05 09:14:45.298007+02:00 [debug] <0.800.0> Authentication using an OAuth 2/JWT token failed: {invalid_aud,
2023-05-05 09:14:45.298007+02:00 [debug] <0.800.0> {resource_id_not_found_in_aud,
2023-05-05 09:14:45.298007+02:00 [debug] <0.800.0> <<"xxxxxx">>,
2023-05-05 09:14:45.298007+02:00 [debug] <0.800.0> [<<"everyone">>]}}
2023-05-05 09:14:45.298100+02:00 [debug] <0.800.0> User 'xxxxxxxx' failed authenticatation by backend rabbit_auth_backend_oauth2
2023-05-05 09:14:45.298191+02:00 [warning] <0.800.0> HTTP access denied: Authentication using an OAuth 2/JWT token failed: {invalid_aud,
2023-05-05 09:14:45.298191+02:00 [warning] <0.800.0> {resource_id_not_found_in_aud,
2023-05-05 09:14:45.298191+02:00 [warning] <0.800.0> <<"xxxxxxxxxxxxxxx">>,
2023-05-05 09:14:45.298191+02:00 [warning] <0.800.0> [<<"everyone">>]}}