Skip to content
Derek Jones edited this page Jul 5, 2012 · 16 revisions

OpenID sure seems promising, right? But it's a mountain of work to implement, until now. Finally a company called JanRain has released RPX, a simple solution for OpenID implementations. It can be found here: https://rpxnow.com/

This great service is free for up to 6 providers. I've made a CI library for it. When using the library, OpenID authentication becomes as easy as this (in a start controller):

function login()
{
    $this->load->library('openidrpx');

    // In the view, display an iframe pointing to the "embedurl"
    $this->load->view('loginview', array('embedurl', $this->openidrpx->EmbedUrl('start/openidverify'));
}

function openidverify()
{
    $this->load->library('openidrpx');
          
    if($token = $this->input->post('token'))
    {
        $data = $this->openidrpx->AuthInfo($token);
        
        if($id = OpenIDRpx::Identifier($data))
        {
             // Authorize user!
        }
    }
}

File:openidrpx-0.92a.zip

Forum thread: http://codeigniter.com/forums/viewthread/126012/

NOTE: The library requires PHP5 and CURL to work.

Clone this wiki locally