Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Yii Framework Extension. EOpenID class extends from CBaseUserIdentity and implements the OpenID protocol to authenticate a user. Based on Mewp's LightOpenID class.
PHP
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
EOpenID.php
README.md

README.md

Introduction

EOpenID class extends from CBaseUserIdentity and implements the OpenID protocol to authenticate a user. Based on Mewp's LightOpenID class.

Flattr this git repo

Resources

Documentation

Requirements

  • Yii 1.0 or above

Installation

  • Extract the release file under protected/components

Usage

The action:

[php]

    public function actionOpenIDLogin() {
        $openid=new EOpenID;

        if(!isset($_GET['openid_mode'])) {
            if(isset($_POST['openid_identifier'])) {
                $openid->authenticate($_POST['openid_identifier']);
            }
        }
        elseif(isset($_GET['openid_mode'])) {
            $openid->validate();
            Yii::app()->user->login($openid);
        }

        $this->render('openIDLogin',array('openid'=>$openid));
    }

The view:

[php]

<div class="form">
<?php echo CHtml::beginForm(); ?>

    <div class="row">
        <?php echo CHtml::label('Identifier:', 'openid_identifier'); ?>
        <?php echo CHtml::textField('openid_identifier', '', array('size'=>40)); ?>
        <p class="hint">
            Hint: You may login with <tt>https://www.google.com/accounts/o8/id</tt>.
        </p>
    </div>

    <div class="row buttons">
        <?php echo CHtml::submitButton('Login'); ?>
    </div>

<?php echo CHtml::endForm(); ?>
</div><!-- form -->

License

Some time ago I developed this extension for InDaHouseRulez SL. I no longer work there, but I still support the extension.

The extension was released under the MIT license, so I made a fork on GitHub, where you'll find the latest version:

https://github.com/jorgebg/yii-eopenid

Change Log

November 2, 2010

  • Updated to new LightOpenID version 0.3 (thanks hightman)

July 27, 2010

  • Initial release.

July 28, 2010

  • Renamed as EOpenID.
  • PHP5 object constructor.
Something went wrong with that request. Please try again.