Skip to content

Commit

Permalink
Disable SSO option for MGS on file share UI
Browse files Browse the repository at this point in the history
Since Kerberos support was added to managed guest sessions (MGS), the
SSO option became available on "add file share" service. This CL removes
this option from the UI, because this service is not working properly on
MGS. See corresponding bug for additional information.

Bug: 1186188
Change-Id: I2a70861ce06f2f764684a22025cfcdb983fd8131
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2743482
Commit-Queue: Felipe Andrade <fsandrade@chromium.org>
Reviewed-by: Kyle Horimoto <khorimoto@chromium.org>
Reviewed-by: Josh Simmons <simmonsjosh@google.com>
Cr-Commit-Position: refs/heads/master@{#861709}
  • Loading branch information
Felipe Andrade authored and Chromium LUCI CQ committed Mar 10, 2021
1 parent 6357f7f commit 1f5cd96
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "chrome/grit/browser_resources.h"
#include "chrome/grit/generated_resources.h"
#include "components/strings/grit/components_strings.h"
#include "components/user_manager/user_manager.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"

Expand Down Expand Up @@ -86,6 +87,10 @@ SmbShareDialogUI::SmbShareDialogUI(content::WebUI* web_ui)
smb_service && smb_service->IsKerberosEnabledViaPolicy();
source->AddBoolean("isKerberosEnabled", is_kerberos_enabled);

bool is_guest = user_manager::UserManager::Get()->IsLoggedInAsGuest() ||
user_manager::UserManager::Get()->IsLoggedInAsPublicAccount();
source->AddBoolean("isGuest", is_guest);

source->UseStringsJs();
source->SetDefaultResource(IDR_SMB_SHARES_DIALOG_CONTAINER_HTML);
source->AddResourcePath("smb_share_dialog.js", IDR_SMB_SHARES_DIALOG_JS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
</cr-input>
<div id="authentication-method"
hidden="[[!shouldShowAuthenticationUI_(isActiveDirectory_,
isKerberosEnabled_)]]">
isKerberosEnabled_, isGuest_)]]">
<label id="authentication-label" class="cr-form-field-label">
[[i18n('smbShareAuthenticationMethod')]]
</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,31 @@ Polymer({
},
},

/** @private */
isGuest_: {
type: Boolean,
value() {
return loadTimeData.getBoolean('isGuest');
},
},

/** @private */
authenticationMethod_: {
type: String,
value() {
return loadTimeData.getBoolean('isActiveDirectoryUser') ||
loadTimeData.getBoolean('isKerberosEnabled') ?
SmbAuthMethod.KERBEROS :
SmbAuthMethod.CREDENTIALS;
// SSO not supported in guest mode. TODO(crbug/1186188): Enable SSO
// option for MGS on file share UI, after fixing authentication error.
if (loadTimeData.getBoolean('isGuest')) {
return SmbAuthMethod.CREDENTIALS;
}

// SSO only supported on ChromAD or Kerberos.
if (loadTimeData.getBoolean('isActiveDirectoryUser') ||
loadTimeData.getBoolean('isKerberosEnabled')) {
return SmbAuthMethod.KERBEROS;
}

return SmbAuthMethod.CREDENTIALS;
},
observer: 'onAuthenticationMethodChanged_',
},
Expand Down Expand Up @@ -214,6 +231,13 @@ Polymer({
* @private
*/
shouldShowAuthenticationUI_() {
// SSO not supported in guest mode. TODO(crbug/1186188): Enable SSO option
// for MGS on file share UI, after fixing authentication error.
if (this.isGuest_) {
return false;
}

// SSO only supported on ChromAD or Kerberos.
return this.isActiveDirectory_ || this.isKerberosEnabled_;
},

Expand Down Expand Up @@ -246,7 +270,6 @@ Polymer({
loadTimeData.getString('smbShareAddedInvalidUsernameMessage'));
break;


// Path Errors
case SmbMountResult.NOT_FOUND:
this.setPathError_(
Expand Down

0 comments on commit 1f5cd96

Please sign in to comment.