Commit 3b474cf2 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Stub in the front part of the Geni authorization support.

parent 0f8a3074
<?php
#
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
# This file is part of the Emulab network testbed software.
#
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
# License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this file. If not, see <http://www.gnu.org/licenses/>.
#
# }}}
#
chdir("..");
include("defs.php3");
chdir("apt");
include("quickvm_sup.php");
$page_title = "Login";
#
# Get current user but make sure coming in on SSL.
#
RedirectSecure();
$this_user = CheckLogin($check_status);
if (0 && $CHECKLOGIN_STATUS & CHECKLOGIN_LOGGEDIN) {
SPITUSERERROR("You are already logged in!");
}
$hash = GENHASH();
SPITHEADER(1);
# Place to hang the toplevel template.
echo "<div id='page-body'></div>\n";
echo "<script type='text/javascript'>\n";
echo " window.HOST = 'https://www.emulab.net';\n";
echo " window.PATH = '/protogeni/speaks-for/index.html';\n";
echo " window.HASH = '$hash';\n";
echo " window.ID = 'urn:publicid:IDN+emulab.net+authority+s';\n";
echo " window.CERT = ";
?>
'-----BEGIN CERTIFICATE-----\n' +
'MIIDoTCCAwqgAwIBAgIDAS/uMA0GCSqGSIb3DQEBBAUAMIG4MQswCQYDVQQGEwJV\n' +
'UzENMAsGA1UECBMEVXRhaDEXMBUGA1UEBxMOU2FsdCBMYWtlIENpdHkxHTAbBgNV\n' +
'BAoTFFV0YWggTmV0d29yayBUZXN0YmVkMR4wHAYDVQQLExVDZXJ0aWZpY2F0ZSBB\n' +
'dXRob3JpdHkxGDAWBgNVBAMTD2Jvc3MuZW11bGFiLm5ldDEoMCYGCSqGSIb3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qRvZqMOm5R//SSNBFl83lZzlu\n' +
'-----END CERTIFICATE-----';
<?php
echo "</script>\n";
echo "<script src='$APTBASE/xml-signer/geni-auth.js'></script>\n";
echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
echo "<script src='js/lib/bootstrap.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/geni-login'></script>\n";
SPITFOOTER();
?>
require(window.APT_OPTIONS.configObject,
['underscore', 'js/quickvm_sup',
'js/lib/text!template/geni-login.html'],
function (_, sup, loginString)
{
'use strict';
function initialize()
{
window.APT_OPTIONS.initialize(sup);
genilib.trustedHost = window.HOST;
genilib.trustedPath = window.PATH;
$('#page-body').html(loginString);
$('#authorize').click(function (event) {
event.preventDefault();
genilib.authorize(window.ID, window.CERT, complete);
return false;
});
}
function complete(credential)
{
$('#credential').show();
$('#credential').val(credential);
}
$(document).ready(initialize);
});
<div class='col-lg-4 col-lg-offset-4
col-md-6 col-md-offset-3
col-sm-10 col-sm-offset-1
col-xs-12'>
<div class='panel panel-default'>
<div class='panel-heading'>
<center><h3 class='panel-title'>Geni Login</h3></center>
</div>
<div class='panel-body'>
<p>
You can use your Geni credentials to sign into CloudLab. Just press
the button below to get started.
</p>
<center>
<br>
<button type='button' id='authorize'
class='btn btn-primary btn-sm'>
Start</button>
</center>
</div>
</div>
<br>
<center>
<textarea id="credential" class='hidden'
cols=85 rows="10">credential</textarea>
</center>
</div>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment