Update CrOS OOBE throbber to MD throbber; delete old asset
[chromium-blink-merge.git] / chrome / test / data / login / saml_api_login.html
blob715c2e9a8665240b35977f1d0e386509b1b96933
1 <html>
2 <head>
3 <script type="text/javascript">
4 var initialized = false;
5 var sendAndSumitRequested = false;
7 function initialize() {
8 window.addEventListener('message', function(event) {
9 if (!event.data || event.data.type != 'gaia_saml_api_reply')
10 return;
11 var response = event.data.response;
12 if (response.result != 'initialized' ||
13 response.version != 1 ||
14 response.keyTypes.indexOf('KEY_TYPE_PASSWORD_PLAIN') == -1) {
15 return;
17 initialized = true;
18 if (sendAndSumitRequested)
19 send_and_submit();
20 });
22 window.setTimeout(function() {
23 window.postMessage({
24 type: 'gaia_saml_api',
25 call: {method: 'initialize', requestedVersion: 1}}, '/');
26 }, 0);
29 function send_and_submit() {
30 if (!initialized) {
31 sendAndSumitRequested = true;
32 return;
34 var form = document.forms[0];
35 var token = form.elements['RelayState'].value;
36 var user = form.elements['Email'].value;
37 var password = form.elements['Password'].value;
38 window.setTimeout(function() {
39 window.postMessage({
40 type: 'gaia_saml_api',
41 call: {method: 'add',
42 token: token,
43 user: user,
44 passwordBytes: password,
45 keyType: 'KEY_TYPE_PASSWORD_PLAIN'}}, '/');
46 form.submit();
47 }, 0);
49 </script>
50 </head>
51 <body onload="initialize();">
52 <form method=post action="$Post">
53 <input type=hidden name=RelayState value="$RelayState">
54 User: <input type=text id=Email name=Email>
55 <!-- The dummy input is part of a regression test: The password scraper
56 picks up the contents of the first type=password input field. The
57 credentials passing API should overrule the password scraper and
58 ensure that the user's actual password is used instead.
59 See http://crbug.com/490737 -->
60 Dummy: <input type=password id=Dummy name=Dummy>
61 Password: <input type=password id=Password name=Password>
62 <input id=Submit type=button value="Login" onclick="send_and_submit();"/>
63 </form>
64 </body>
65 </html>