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')
11 var response
= event
.data
.response
;
12 if (response
.result
!= 'initialized' ||
13 response
.version
!= 1 ||
14 response
.keyTypes
.indexOf('KEY_TYPE_PASSWORD_PLAIN') == -1) {
18 if (sendAndSumitRequested
)
22 window
.setTimeout(function() {
24 type
: 'gaia_saml_api',
25 call
: {method
: 'initialize', requestedVersion
: 1}}, '/');
29 function send_and_submit() {
31 sendAndSumitRequested
= true;
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() {
40 type
: 'gaia_saml_api',
44 passwordBytes
: password
,
45 keyType
: 'KEY_TYPE_PASSWORD_PLAIN'}}, '/');
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 Password:
<input type=password id=Password name=Password
>
56 <input id=Submit type=button
value=
"Login" onclick=
"send_and_submit();"/>