From 80f34dcb9828a5ae0cdebf7892725ea601ed139e Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Fri, 26 Feb 2016 15:25:20 +0100 Subject: [PATCH] rgw: try to parse Keystone token in order appropriate to configuration. Signed-off-by: Radoslaw Zarzynski --- src/rgw/rgw_keystone.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_keystone.cc b/src/rgw/rgw_keystone.cc index ba18d349651..5e9d63af28b 100644 --- a/src/rgw/rgw_keystone.cc +++ b/src/rgw/rgw_keystone.cc @@ -51,15 +51,15 @@ int KeystoneToken::parse(CephContext *cct, bufferlist& bl) try { const auto version = KeystoneService::get_api_version(); - if (version == KeystoneApiVersion::VER_3) { + if (version == KeystoneApiVersion::VER_2) { if (!JSONDecoder::decode_json("access", *this, &parser)) { /* Token structure doesn't follow Identity API v2, so the token * must be in v3. Otherwise we can assume it's wrongly formatted. */ JSONDecoder::decode_json("token", *this, &parser, true); } - } else if (version == KeystoneApiVersion::VER_2) { + } else if (version == KeystoneApiVersion::VER_3) { if (!JSONDecoder::decode_json("token", *this, &parser)) { - /* If the token cannot be parsed according to V2, try V3. */ + /* If the token cannot be parsed according to V3, try V2. */ JSONDecoder::decode_json("access", *this, &parser, true); } } else { -- 2.39.5