Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...

When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Using the Zend_InfoCard component standalone

It is also possible to use the Zend_InfoCard component as a standalone component by interacting with the Zend_InfoCard class directly. Using the Zend_InfoCard class is very similar to its use with the Zend_Auth component. An example of its use is shown below:

if (isset($_POST['xmlToken'])) {
$infocard = new Zend_InfoCard();

$claims $infocard->process($_POST['xmlToken']);

$claims->isValid()) {
"Given Name: {$claims->givenname}<br />";
"Surname: {$claims->surname}<br />";
"Email Address: {$claims->emailaddress}<br />";
"PPI: {$claims->getCardID()}<br />";
    } else {
"Error Validating identity: {$claims->getErrorMsg()}";
<hr />
<div id="login" style="font-family: arial; font-size: 2em;">
 <p>Simple Login Demo</p>
 <form method="post">
  <input type="submit" value="Login" />
   <object type="application/x-informationCard" name="xmlToken">
    <param name="tokenType"
          value="urn:oasis:names:tc:SAML:1.0:assertion" />
    <param name="requiredClaims"
                 http://.../claims/privatepersonalidentifier" />

In the example above, we use the Zend_InfoCard component independently to validate the token provided by the user. As was the case with the Zend_Auth_Adapter_InfoCard, we create an instance of Zend_InfoCard and then set one or more SSL certificate public/private key pairs used by the web server. Once configured, we can use the process() method to process the information card and return the results.

Zend Framework