File tree Expand file tree Collapse file tree 4 files changed +26
-10
lines changed Expand file tree Collapse file tree 4 files changed +26
-10
lines changed Original file line number Diff line number Diff line change @@ -1110,7 +1110,8 @@ configuration::configuration()
1110
1110
, sasl_mechanisms(
1111
1111
*this ,
1112
1112
" sasl_mechanisms" ,
1113
- " A list of supported SASL mechanisms. `SCRAM` and `GSSAPI` are allowed." ,
1113
+ " A list of supported SASL mechanisms. `SCRAM`, `GSSAPI`, and "
1114
+ " `OAUTHBEARER` are allowed." ,
1114
1115
{.needs_restart = needs_restart::no, .visibility = visibility::user},
1115
1116
{" SCRAM" },
1116
1117
validate_sasl_mechanisms)
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ std::optional<ss::sstring> validate_client_groups_byte_rate_quota(
109
109
std::optional<ss::sstring>
110
110
validate_sasl_mechanisms (const std::vector<ss::sstring>& mechanisms) {
111
111
static const absl::flat_hash_set<std::string_view> supported{
112
- " GSSAPI" , " SCRAM" };
112
+ " GSSAPI" , " SCRAM" , " OAUTHBEARER " };
113
113
114
114
// Validate results
115
115
for (const auto & m : mechanisms) {
Original file line number Diff line number Diff line change 52
52
#include " security/exceptions.h"
53
53
#include " security/gssapi_authenticator.h"
54
54
#include " security/mtls.h"
55
+ #include " security/oidc_authenticator.h"
55
56
#include " security/scram_algorithm.h"
56
57
#include " security/scram_authenticator.h"
57
58
#include " ssx/future-util.h"
@@ -567,6 +568,18 @@ ss::future<response_ptr> sasl_handshake_handler::handle(
567
568
}
568
569
}
569
570
571
+ if (supports (security::oidc::sasl_authenticator::name)) {
572
+ supported_sasl_mechanisms.emplace_back (
573
+ security::oidc::sasl_authenticator::name);
574
+
575
+ if (
576
+ request.data .mechanism == security::oidc::sasl_authenticator::name) {
577
+ ctx.sasl ()->set_mechanism (
578
+ std::make_unique<security::oidc::sasl_authenticator>(
579
+ ctx.connection ()->server ().oidc_service ().local ()));
580
+ }
581
+ }
582
+
570
583
if (!ctx.sasl ()->has_mechanism ()) {
571
584
error = error_code::unsupported_sasl_mechanism;
572
585
}
Original file line number Diff line number Diff line change 13
13
from rptest .services .redpanda import LoggingConfig , SecurityConfig , make_redpanda_service
14
14
from rptest .services .keycloak import KeycloakService
15
15
from rptest .services .cluster import cluster
16
- from rptest .util import expect_exception
17
- from confluent_kafka import KafkaException
18
16
19
17
CLIENT_ID = 'myapp'
20
18
TOKEN_AUDIENCE = 'account'
@@ -55,10 +53,15 @@ def __init__(self,
55
53
security .enable_sasl = True
56
54
security .sasl_mechanisms = sasl_mechanisms
57
55
58
- self .redpanda = make_redpanda_service (test_context ,
59
- num_brokers ,
60
- security = security ,
61
- log_config = log_config )
56
+ self .redpanda = make_redpanda_service (
57
+ test_context ,
58
+ num_brokers ,
59
+ extra_rp_conf = {
60
+ "oidc_discovery_url" : self .keycloak .get_discovery_url (kc_node ),
61
+ "oidc_token_audience" : TOKEN_AUDIENCE ,
62
+ },
63
+ security = security ,
64
+ log_config = log_config )
62
65
63
66
self .su_username , self .su_password , self .su_algorithm = self .redpanda .SUPERUSER_CREDENTIALS
64
67
@@ -112,5 +115,4 @@ def test_init(self):
112
115
# metadata requests to behave nicely.
113
116
producer .poll (0.0 )
114
117
115
- with expect_exception (KafkaException , lambda _ : True ):
116
- producer .list_topics (timeout = 5 )
118
+ producer .list_topics (timeout = 5 )
You can’t perform that action at this time.
0 commit comments