phpPoA2
[ class tree: phpPoA2 ] [ index: phpPoA2 ] [ all elements ]

Source for file openid-ext.php

Documentation is available at openid-ext.php

  1. <?php
  2. /**
  3.  * This is a sample file to demonstrate the functionality of the phpPoA2 package.
  4.  * @author Miguel Macías <miguel.macias@upv.es>
  5.  * @filesource
  6.  * @package phpPoA2
  7.  */
  8.  
  9. include('../PoA.php');
  10.  
  11. $poa new PoA('openid3');
  12. ?>
  13. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  14. <html xmlns="http://www.w3.org/1999/xhtml" lang="es" xml:lang="es">
  15.  <head>
  16.   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  17.   <title>OpenID external login example</title>
  18.  </head>
  19.  
  20.  <body>
  21.   <h1>OpenID external login example</h1>
  22.   <h2>authenticate() + getAttributes()</h2>
  23.   <hr/>
  24. <?php
  25. $auth $poa->authenticate();
  26. if ($auth{
  27. ?>
  28.   <p><strong>authenticate()</strong>: <div style="background: #ccffcc; padding: 5px"><tt>AUTHN_SUCCESS</tt></div></p>
  29.   <p><strong>getAttributes()</strong>:</p>
  30.   <div style="background: #cccccc; padding: 5px"><pre><?=print_r($poa->getAttributes());?></pre></div>
  31. <?php
  32. else {
  33. ?>
  34.   <p><strong>authenticate()</strong>: <div style="background: #ffcccc; padding: 5px"><tt>AUTHN_FAILED</tt></div></p>
  35. <?php
  36. }
  37. ?>
  38.  </body>
  39. </html>

Documentation generated on Mon, 20 Feb 2012 12:07:06 +0100 by phpDocumentor 1.4.3