We are going to implement an openID consumer on the basis of http://openidenabled.com Version 2.0.1.
An additional folder “openid” is added to the webfolder and excluded from wiki access:
RewriteCond%{REQUEST_URI} !/(@api|editor|skins|config|openid)/.
We will use the modified mindtouch.deki.services.dll and mindtouch.deki.dll from:
http://wiki.opengarden.org/Deki_Wiki/Specs/Trusted_Authentication
const OPENID = 'http://openidenabled.com/';
case WebService::OPENID:
{
return $this->PrepareLoginHtml(self::LOGINOPENID, $lService->GetId());
}
case self::LOGINOPENID:
{
$lTableCells = array();
$lTableCells[] = new TableCell($lSubmit2->GetHtml());
$lTableRows[] = $lTableCells;
break;
}
$lSubmit2 = new SubmitFormTag($this->mHtmlTagNames['submit_openid']);
$lSubmit2->SetValue($this->mHtmlSubmitValues['openid']);
$lSubmit2->SetTagParam('tabindex', '8'); 'submit_openid' => 'dosubmit_openid'
'openid' => wfMsg('Page.UserLogin.submit-openid') . ' >>',
function SaveCreds()
{
if(nameTag = document.getElementById(\''.$this->mHtmlTagIds['name'].'\')){
var lName = nameTag.value;
var lPwd = document.getElementById(\''.$this->mHtmlTagIds['password'].'\').value;
x_wfSaveLoginPageCreds(lName, lPwd, SaveCreds_cb);
}
}
else if ($this->mRequest->getCheck($this->mHtmlTagNames['submit_openid'])){$this->RedirectOpenID();}
function GetOpenIDConsumer($aAuthServiceId)
{
$lDream = new DreamServiceManagement();
$lDream->SuppressErrors();
$lService = $lDream->GetById($aAuthServiceId);
if (is_object($lService))
{
$ConfArr = $lService->GetConfig();
return ($ConfArr['Consumer']);
}
}
function RedirectOpenID(){
$_SESSION['i2s_origin'] = "http://" . $_SERVER['SERVER_NAME'] . ereg_replace("Special:Userlogin", "", $_SERVER['REQUEST_URI']);
$consumer = $this->GetOpenIDConsumer($this->mRequest->getVal($this->mHtmlTagNames['service']));
$this->mOutput->redirect( "$consumer", '301');
}
1.integrate OpenID Consumer into Deki-Wiki as a class by loading OpenID library directly, avoiding unnecessary redirections and allowing the use of a custom or predefined OpenID Provider . “Consumer” config parameter will then be replaced by “Provider” parameter. If no Provider was added by Deki-Wiki administration user will be given the option to input a custom one on login page.
2.if openID authentication does succeed but user is non-existent in Deki-Wiki Database, a new user needs to be created with an openID and a username. Currently the created username equals the openID resulting in the OpenID string being displayed instead of the actual username in Deki-Wiki. The Database needs to be modified as well to contain the actual username and OpenID string or multiple OpenIDs for a single user if stored in a separate table.
| File | Size | Date | Attached by | |||
|---|---|---|---|---|---|---|
| modified_deki_wiki.rar modified frontend | 29.23 kB | 13:30, 20 May 2008 | kostya | Actions | ||
| modified_openid_consumer_files.rar modified consumer | 3.7 kB | 13:30, 20 May 2008 | kostya | Actions | ||