Skip to content

Commit 1ebc174

Browse files
lkotuladahlerlend
authored andcommitted
Bug#37309796 - Inconsistent authentication parameter format and names for MRS Authentication
Description =========== As an MRS user, I expect that the login workflow for different authentication apps should be, as much as possible, similar with regards to the required authentication parameter names, values and mechanisms with which these are specified. Currently different workflows for different authentication apps also use different ways of specifying the same authentication parameters and use a confusing mix of both query parameters and JSON request bodies. Additionally, in certain cases, the same parameters are encoded using different names for different workflows, which can also be confusing and potentially avoided (e.g. "user" vs "username", "app" vs "authApp"). Fix === The following AUTH-APPs will use "username" JSON field for transferring user information in POST requests: * MRS * MySQL Internal (POST-PUSH FIX WL#15440) Change-Id: I5eb238baa1cc0f4e313d655a9dd8cb0735d4b720
1 parent f1438af commit 1ebc174

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

router/src/mysql_rest_service/src/mrs/authentication/helper/scram.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ class JsonAuthInitRequest
191191
public:
192192
bool String(const Ch *cstr, rapidjson::SizeType clength, bool) override {
193193
if (!is_object_path()) return true;
194-
if ("user" == get_current_key())
194+
if ("username" == get_current_key())
195195
result_.user.assign(cstr, clength);
196196
else if ("nonce" == get_current_key())
197197
result_.nonce.assign(cstr, clength);

router/tests/mrs_client/client/authentication.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ Result Authentication::do_scram_post_flow(
491491

492492
JsonObject request_data{
493493
{"sessionType", (st == SessionType::kJWT ? "bearer" : "cookie")},
494-
{"user", user},
494+
{"username", user},
495495
{"nonce", scram.initial_nonce_}};
496496

497497
if (auth_app.has_value()) {

0 commit comments

Comments
 (0)