forked from bcit-ci/CodeIgniter
-
Notifications
You must be signed in to change notification settings - Fork 0
OpenIDRpx
World Wide Web Server edited this page Jul 4, 2012
·
16 revisions
OpenID sure seems promising, right? But it's a mountain of work to implement, until now. Finally a company called RPX has made a simple solution for OpenID implementations. They can be found here: [url]https://rpxnow.com/[/url]
I've made a library for this great service, which is free for up to 6 providers. When using the library, OpenID authentication becomes as easy as this (in a start controller):
[code] 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!
}
}
} [/code]