Commit 38ac5dda authored by Rakesh Soma's avatar Rakesh Soma Committed by Commit Bot

Change AD username from forward slash to back slash

Bug: 1055726
Change-Id: Ibbdfdaff9c56175dd6f3b795f08b395f0f3bbcfc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2072118
Commit-Queue: Rakesh Soma <rakeshsoma@google.com>
Reviewed-by: default avatarYusuf Sengul <yusufsn@google.com>
Reviewed-by: default avatarTien Mai <tienmai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#744384}
parent e0f23c8e
......@@ -254,8 +254,11 @@ HRESULT GetUserAndDomainInfo(
// Login via existing AD account mapping when the device is domain joined if
// the AD account mapping is available.
if (is_ad_user) {
// The format for ad_upn custom attribute is domainName/userName.
const base::char16 kSlashDelimiter[] = STRING16_LITERAL("/");
// The format for ad_upn custom attribute is domainName\\userName.
// Note that admin configures it as "domainName\userName" but admin
// sdk stores it with another escape backslash character in it leading
// multiple backslashes.
const base::char16 kSlashDelimiter[] = STRING16_LITERAL("\\");
std::vector<base::string16> tokens =
base::SplitString(base::UTF8ToUTF16(sam_account_name), kSlashDelimiter,
base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
......
......@@ -1434,7 +1434,7 @@ TEST_F(GcpGaiaCredentialBaseAdScenariosTest,
// Invalid configuration in admin sdk. Don't set the username.
std::string admin_sdk_response = base::StringPrintf(
"{\"customSchemas\": {\"Enhanced_desktop_security\": {\"AD_accounts\":"
" \"%ls/\"}}}",
" \"%ls\\\\\"}}}",
domain_name);
fake_http_url_fetcher_factory()->SetFakeResponse(
GURL(get_cd_user_url_.c_str()), FakeWinHttpUrlFetcher::Headers(),
......@@ -1489,7 +1489,7 @@ TEST_F(GcpGaiaCredentialBaseAdScenariosTest,
// Set valid response from admin sdk.
std::string admin_sdk_response = base::StringPrintf(
"{\"customSchemas\": {\"Enhanced_desktop_security\": {\"AD_accounts\":"
" \"%ls/%ls\"}}}",
" \"%ls\\\\%ls\"}}}",
domain_name, user_name);
fake_http_url_fetcher_factory()->SetFakeResponse(
GURL(get_cd_user_url_.c_str()), FakeWinHttpUrlFetcher::Headers(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment