Child pages
  • Shibbolized Web Application Sample1

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

index.html

Code Block
<html>
  <head>
    <title>Sample Web Application</title>
  </head>
  <body marginheight="50" marginwidth="100">
    <H1>Sample Web Application</H1>
    <div style="border-style: solid; border-width: 1px; padding: 10px 5px 10px 20px;">
      <center>
      Let's learn how to use shibboleth authorization</br>
      ONLY UNIVERSITY STAFF CAN LOGIN THIS PAGE</br></br>
      <button type="button" onclick="location.href='https://sp.sifulan.asia/secure/webapp.php'">Login</button>
      </center>
    </div>
  </body>
</html>

webapp.php

Code Block
<html>
  <head>
    <title>Sample Web Application for Checking Server Environment</title>
  </head>
  <body>
    <?PHP
      $eppn = $_SERVER['eppn'];
      $epa  = $_SERVER['unscoped-affiliation'];
      print "Your EPPN = ".$eppn."</br>";
      print "Your Affiliation = ".$epa."</br></br>";
      if ($epa == "staff") {
        print "You have the privilege to access this page. Please check server environments.</br></br>";
        phpinfo();
      } else {
        print "You have no privilege to access this page.</br>";
        print "Your access has been reported to the system administrator.";
      }
    ?>
  </body>
</html>