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

Attaching Information Cards to existing accounts

It is possible to add support for information cards to an existing authentication system by storing the private personal identifier (PPI) to a previously traditionally-authenticated account and including at least the claim as part of the requiredClaims of the request. If this claim is requested then the Zend_InfoCard_Claims object will provide a unique identifier for the specific card that was submitted by calling the getCardID() method.

An example of how to attach an information card to an existing traditional-authentication account is shown below:

// ...
public function submitinfocardAction()
    if (!isset(
$_REQUEST['xmlToken'])) {
        throw new 
ZBlog_Exception('Expected an encrypted token ' .
'but was not provided');

$infoCard = new Zend_InfoCard();

    try {
$claims $infoCard->process($request['xmlToken']);
    } catch(
Zend_InfoCard_Exception $e) {
// TODO Error processing your request
throw $e;

    if (
$claims->isValid()) {
$db ZBlog_Data::getAdapter();

$ppi $db->quote($claims->getCardID());
$fullname $db->quote("{$claims->givenname} {$claims->surname}");

$query "UPDATE blogusers
                     SET ppi = 
                         real_name = 
                   WHERE username='administrator'"

        try {
        } catch(
Exception $e) {
// TODO Failed to store in DB

    } else {
        throw new
ZBlog_Exception("Infomation card failed security checks");

Zend Framework