我有一個Joomla網站,也是一個Java/jsp網站。 我正在嘗試爲Joomla創建一個自定義身份驗證插件以從我的jsp應用程序獲取身份驗證詳細信息。Joomla 2.5自定義身份驗證插件通過外部jsp網站進行身份驗證
所以作爲第一次嘗試,我編輯了默認的joomla身份驗證插件類中的onUserAuthenticate()
函數。
function onUserAuthenticate($credentials, $options, &$response)
{
$response->type = 'joomla';
// Joomla does not like blank passwords
if (empty($credentials['password'])) {
$response->status = JAuthentication::STATUS_FAILURE;
$response->error_message = JText::_('JGLOBAL_AUTH_EMPTY_PASS_NOT_ALLOWED');
return false;
}else{
$response->status = JAuthentication::STATUS_SUCCESS;
return true;
}
}
正如我猜測,它應該工作的任何憑據,但事實並非如此..
我已經有一個用戶調用admin
現在登錄與用戶名admin
工作的任何密碼。但這不是我所期望的。我需要以anything
作爲用戶名和anything
作爲密碼登錄。
作爲第一次嘗試我需要完全停止訪問默認joomla數據庫的憑據。但驗證腳本仍在尋找本地數據庫。 請幫我解決這個問題..
也很感謝,如果你能建議一個很好的方式與jsp網站溝通。
我要嘗試用SOAP,像這樣:
$credentials = array(
'memberNumber' => $credentials['username'],
'password' => $credentials['password']
);
$client = new SoapClient('http://example.com/soap.wsdl', $credentials);
這是從我的JSP應用程序反饋的最佳方式?