forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI for lock screen online re-authentication
The saml user will be forced to re-authenticate through online flow in the lockscreen. This feature is enable by setting kDefaultSamlLockScreenReauthenticationEnabled to true. Bug: 1113295 Change-Id: I7f89408aca31de9137006d5cbb96cfc91ee708d8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2339359 Reviewed-by: Denis Kuznetsov [CET] <antrim@chromium.org> Reviewed-by: Roman Sorokin [CET] <rsorokin@chromium.org> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org> Commit-Queue: Mohammed Abdon <mohammedabdon@chromium.org> Cr-Commit-Position: refs/heads/master@{#811655}
- Loading branch information
Mohammed Abdon
authored and
Commit Bot
committed
Sep 29, 2020
1 parent
85f072c
commit 63db7d5
Showing
26 changed files
with
601 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
chrome/app/chromeos_strings_grdp/IDS_LOCK_SCREEN_CANCEL_BUTTON.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
078b283c6e11478112e9461ae86bf07a0f9aceb7 |
1 change: 1 addition & 0 deletions
1
chrome/app/chromeos_strings_grdp/IDS_LOCK_SCREEN_REAUTH_SUBTITLE.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
078b283c6e11478112e9461ae86bf07a0f9aceb7 |
1 change: 1 addition & 0 deletions
1
chrome/app/chromeos_strings_grdp/IDS_LOCK_SCREEN_VERIFICATION_FAILED.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
9ae3a4fddbcc6f3f1533b1f366ff444fe6da91cb |
1 change: 1 addition & 0 deletions
1
chrome/app/chromeos_strings_grdp/IDS_LOCK_SCREEN_VERIFY_ACCOUNT.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
078b283c6e11478112e9461ae86bf07a0f9aceb7 |
1 change: 1 addition & 0 deletions
1
chrome/app/chromeos_strings_grdp/IDS_LOCK_SCREEN_VERIFY_AGAIN_BUTTON.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
9ae3a4fddbcc6f3f1533b1f366ff444fe6da91cb |
1 change: 1 addition & 0 deletions
1
chrome/app/chromeos_strings_grdp/IDS_LOCK_SCREEN_VERIFY_BUTTON.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
078b283c6e11478112e9461ae86bf07a0f9aceb7 |
1 change: 1 addition & 0 deletions
1
chrome/app/chromeos_strings_grdp/IDS_LOCK_SCREEN_WRONG_USER.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
9ae3a4fddbcc6f3f1533b1f366ff444fe6da91cb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
129 changes: 129 additions & 0 deletions
129
chrome/browser/resources/chromeos/password_change/lock_screen_reauth.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
<!doctype html> | ||
<html dir="$i18n{textdirection}" lang="$i18n{language}"> | ||
|
||
<head> | ||
<include src="../login/components/oobe_icons.html"> | ||
<link rel="stylesheet" href="chrome://resources/css/text_defaults.css"> | ||
|
||
<script src="chrome://resources/js/cr.js"></script> | ||
<script src="chrome://resources/js/cr/event_target.js"></script> | ||
<script src="chrome://resources/js/load_time_data.js"></script> | ||
<script src="chrome://resources/js/util.js"></script> | ||
<script src="chrome://lock-reauth/authenticator.js"></script> | ||
|
||
<script type="module" src="chrome://lock-reauth/lock_screen_reauth.js"></script> | ||
|
||
<dom-module id="lock-reauth"> | ||
<template> | ||
<style> | ||
::part(dialog) { | ||
/* The HTML dialog should fill the entire system dialog. */ | ||
height: 100%; | ||
width: 100%; | ||
display: flex; | ||
} | ||
|
||
::part(wrapper) { | ||
height: 100%; | ||
width: 100%; | ||
display: flex; | ||
} | ||
|
||
#saml-close-button { | ||
--cr-icon-button-margin-end: 0; | ||
--cr-icon-button-margin-start: 0; | ||
} | ||
|
||
[slot='body'], | ||
#signin-frame { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
#title-icon { | ||
--iron-icon-height: 32px; | ||
--iron-icon-width: 32px; | ||
/* #1a73e8 */ | ||
--iron-icon-fill-color: rgb(26, 115, 232); | ||
} | ||
|
||
[slot='header'] { | ||
background: white; | ||
padding-bottom: 0; | ||
padding-inline-end: 64px; | ||
padding-inline-start: 64px; | ||
padding-top: 64px; | ||
flex: 1; | ||
} | ||
|
||
[slot='header'], | ||
#title { | ||
/* #202124 */ | ||
color: rgb(32, 33, 36); | ||
font-size: 28px; | ||
font-weight: 400; | ||
padding-top: 20px; | ||
margin: 0; | ||
} | ||
|
||
[slot='header'], | ||
#subtitle { | ||
/* #5f6368 */ | ||
color: rgb(95, 99, 104); | ||
font-size: 13px; | ||
font-weight: 400; | ||
padding-top: 8px; | ||
margin: 0; | ||
} | ||
|
||
[slot="button-container"] { | ||
padding: 40px; | ||
} | ||
</style> | ||
<cr-dialog id="dialog" exportparts="dialog"> | ||
<div slot="header"> | ||
<iron-icon id="title-icon" icon="oobe-64:alert"></iron-icon> | ||
<div id="title" hidden="[[isErrorDisplayed_]]"> | ||
$i18n{loginWelcomeMessage} | ||
</div> | ||
<div id="title" hidden="[[!isErrorDisplayed_]]"> | ||
$i18n{loginWelcomeMessageWithError} | ||
</div> | ||
<div id="subtitle" hidden="[[isErrorDisplayed_]]"> | ||
$i18n{lockScreenReauthSubtitile} | ||
</div> | ||
<div id="subtitle" hidden="[[!isErrorDisplayed_]]"> | ||
$i18n{lockScreenReauthSubtitileWithError} | ||
</div> | ||
</div> | ||
<div slot="body" hidden="[[isButtonsEnabled_]]"> | ||
<cr-icon-button id="saml-close-button" iron-icon="cr:close" on-click="onCloseTap_"> | ||
</cr-icon-button> | ||
<webview id="signin-frame" name="signin-frame" class="flex"> | ||
</webview> | ||
</div> | ||
<div slot="button-container" class="flex layout horizontal"> | ||
<cr-button id="cancelButton" class="cancel-button" on-click="onCloseTap_" | ||
hidden="[[!isButtonsEnabled_]]"> | ||
$i18n{lockScreenCancelButton} | ||
</cr-button> | ||
<cr-button id="nextButton" class="action-button" on-click="onNext_" | ||
hidden="[[!isVerifyButtonEnabled_]]"> | ||
$i18n{lockScreenVerifyButton} | ||
</cr-button> | ||
<cr-button id="nextButton" class="action-button" on-click="onNext_" | ||
hidden="[[!isVerifyAgainButtonEnabled_]]"> | ||
$i18n{lockScreenVerifyAgainButton} | ||
</cr-button> | ||
</div> | ||
</cr-dialog> | ||
</template> | ||
</dom-module> | ||
</head> | ||
|
||
<body> | ||
<lock-reauth id="main-element"> | ||
</lock-reauth> | ||
</body> | ||
|
||
</html> |
106 changes: 106 additions & 0 deletions
106
chrome/browser/resources/chromeos/password_change/lock_screen_reauth.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
// Copyright 2020 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
/** | ||
* @fileoverview An UI component to let user init online re-auth flow on | ||
* the lock screen. | ||
*/ | ||
|
||
|
||
import {assert} from 'chrome://resources/js/assert.m.js'; | ||
import {I18nBehavior} from 'chrome://resources/js/i18n_behavior.m.js'; | ||
import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; | ||
import {Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; | ||
import 'chrome://resources/cr_elements/cr_button/cr_button.m.js'; | ||
import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.m.js'; | ||
import 'chrome://resources/cr_elements/icons.m.js'; | ||
|
||
|
||
Polymer({ | ||
is: 'lock-reauth', | ||
behaviors: [I18nBehavior], | ||
|
||
properties: { | ||
isErrorDisplayed_: { | ||
type: Boolean, | ||
value: false, | ||
}, | ||
|
||
isButtonsEnabled_: { | ||
type: Boolean, | ||
value: true, | ||
}, | ||
|
||
isVerifyButtonEnabled_: { | ||
type: Boolean, | ||
computed: | ||
'computeVerifyButtonEnabled_(isErrorDisplayed_,isButtonsEnabled_)', | ||
}, | ||
|
||
isVerifyAgainButtonEnabled_: { | ||
type: Boolean, | ||
computed: | ||
'computeVerifyAgainButtonEnabled_(isErrorDisplayed_,isButtonsEnabled_)', | ||
}, | ||
}, | ||
|
||
/** | ||
* The UI component that hosts IdP pages. | ||
* @type {!cr.login.Authenticator|undefined} | ||
*/ | ||
authenticator_: undefined, | ||
|
||
/** | ||
* Webview that view IdP page | ||
* @type {!webview|undefined} | ||
* @private | ||
*/ | ||
signinFrame_: undefined, | ||
|
||
/** @override */ | ||
attached() { | ||
this.$.dialog.showModal(); | ||
}, | ||
|
||
/** @override */ | ||
ready() { | ||
this.signinFrame_ = this.getSigninFrame_(); | ||
this.authenticator_ = new cr.login.Authenticator(this.signinFrame_); | ||
chrome.send('initialize'); | ||
}, | ||
|
||
/** | ||
* @return {!Element} | ||
* @private | ||
*/ | ||
getSigninFrame_() { | ||
// Note: Can't use |this.$|, since it returns cached references to elements | ||
// originally present in DOM, while the signin-frame is dynamically | ||
// recreated (see Authenticator.setWebviewPartition()). | ||
const signinFrame = this.shadowRoot.getElementById('signin-frame'); | ||
assert(signinFrame); | ||
return signinFrame; | ||
}, | ||
|
||
/** @private */ | ||
computeVerifyButtonEnabled_(isErrorDisplayed, isButtonsEnabled) { | ||
return !isErrorDisplayed && isButtonsEnabled; | ||
}, | ||
|
||
/** @private */ | ||
computeVerifyAgainButtonEnabled_(isErrorDisplayed, isButtonsEnabled) { | ||
return isErrorDisplayed && isButtonsEnabled; | ||
}, | ||
|
||
/** @private */ | ||
onNext_() { | ||
this.isButtonsEnabled_ = false; | ||
}, | ||
|
||
/** @private */ | ||
onCloseTap_() { | ||
chrome.send('dialogClose'); | ||
}, | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.