Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Side by Side Diff: chrome/test/data/login/saml_api_login_v2.html

Issue 258123002: Implement a second version of the credentials passing API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: One more s/requested_version/requestedVersion/ I had missed. Thank you for catching this, browser_t… Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/login/saml_api_login_v1.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script type="text/javascript"> 3 <script type="text/javascript">
4 var initialized = false;
5 var sendAndSumitRequested = false;
6
4 function initialize() { 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 != 2 ||
14 response.keyTypes.indexOf('KEY_TYPE_PASSWORD_PLAIN') == -1) {
15 return;
16 }
17 initialized = true;
18 if (sendAndSumitRequested)
19 send_and_submit();
20 });
21
5 window.setTimeout(function() { 22 window.setTimeout(function() {
6 window.postMessage({ 23 window.postMessage({
7 type: 'gaia_saml_api', 24 type: 'gaia_saml_api',
8 call: {method: 'initialize'}}, '/'); 25 call: {method: 'initialize', requestedVersion: 2}}, '/');
9 }, 0); 26 }, 0);
10 } 27 }
11 28
12 function send_and_submit() { 29 function send_and_submit() {
30 if (!initialized) {
31 sendAndSumitRequested = true;
32 return;
33 }
13 var form = document.forms[0]; 34 var form = document.forms[0];
14 var token = form.elements['RelayState'].value; 35 var token = form.elements['RelayState'].value;
15 var user = form.elements['Email'].value; 36 var user = form.elements['Email'].value;
16 var password = form.elements['Password'].value; 37 var password = form.elements['Password'].value;
17 window.setTimeout(function() { 38 window.setTimeout(function() {
18 window.postMessage({ 39 window.postMessage({
19 type: 'gaia_saml_api', 40 type: 'gaia_saml_api',
20 call: {method: 'add', 41 call: {method: 'add',
21 token: token, 42 token: token,
22 user: user, 43 user: user,
23 password: password}}, '/'); 44 passwordBytes: password,
45 keyType: 'KEY_TYPE_PASSWORD_PLAIN'}}, '/');
24 form.submit(); 46 form.submit();
25 }, 0); 47 }, 0);
26 } 48 }
27 </script> 49 </script>
28 </head> 50 </head>
29 <body onload="initialize();"> 51 <body onload="initialize();">
30 <form method=post action="$Post"> 52 <form method=post action="$Post">
31 <input type=hidden name=RelayState value="$RelayState"> 53 <input type=hidden name=RelayState value="$RelayState">
32 User: <input type=text id=Email name=Email> 54 User: <input type=text id=Email name=Email>
33 Password: <input type=password id=Password name=Password> 55 Password: <input type=password id=Password name=Password>
34 <input id=Submit type=button value="Login" onclick="send_and_submit();"/> 56 <input id=Submit type=button value="Login" onclick="send_and_submit();"/>
35 </form> 57 </form>
36 </body> 58 </body>
37 </html> 59 </html>
OLDNEW
« no previous file with comments | « chrome/test/data/login/saml_api_login_v1.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698