I'm working on a 3rd party application, and I need to make a stand alone login authentication. I don't want to setup a session or create any local data vars of the sort, I just want to check the username/password for a match. The issue standing is that the XF authentication system doesn't make much sense to me. I've looked around the official XF website, but I haven't gathered much. I understand that password/salt data is stored in the `xf_user_authentication` table, but I don't know what to make of it. Would anyone be so kind as to explain to me how passwords are formed and what does what within this table?
[uPDATE]
I've been looking around and found that 'core12.php' (Library/XenForo/Authentication/Core12.php) is responsible for the XF login authentication. I've taken a look at it's contents, and this is the main authentication function,
public function authenticate($userId, $password)
{
if (!is_string($password) || $password === '' || empty($this->_data))
{
return false;
}
$passwordHash = new XenForo_PasswordHash(XenForo_Application::getConfig()->passwordIterations, false);
return $passwordHash->CheckPassword($password, $this->_data['hash']);
}
I'm wondering whether anyone knows how passwords are converted into authentication=>data=>hash
[uPDATE]
So I've found the hashing algo. in 'PasswordHash.php' (Library/XenForo/PasswordHash.php), and I've figured it would be much easier to just include the XF api. My question standing, is how to do so.
Question
Tutu
I'm working on a 3rd party application, and I need to make a stand alone login authentication. I don't want to setup a session or create any local data vars of the sort, I just want to check the username/password for a match. The issue standing is that the XF authentication system doesn't make much sense to me. I've looked around the official XF website, but I haven't gathered much. I understand that password/salt data is stored in the `xf_user_authentication` table, but I don't know what to make of it. Would anyone be so kind as to explain to me how passwords are formed and what does what within this table?
[uPDATE]
I've been looking around and found that 'core12.php' (Library/XenForo/Authentication/Core12.php) is responsible for the XF login authentication. I've taken a look at it's contents, and this is the main authentication function,
public function authenticate($userId, $password) { if (!is_string($password) || $password === '' || empty($this->_data)) { return false; } $passwordHash = new XenForo_PasswordHash(XenForo_Application::getConfig()->passwordIterations, false); return $passwordHash->CheckPassword($password, $this->_data['hash']); }I'm wondering whether anyone knows how passwords are converted into authentication=>data=>hash
[uPDATE]
So I've found the hashing algo. in 'PasswordHash.php' (Library/XenForo/PasswordHash.php), and I've figured it would be much easier to just include the XF api. My question standing, is how to do so.
ie; include( 'xf_main.php' )
[uPDATE]
Problem solved by using the REST api.
Edited by TutuLink to comment
Share on other sites
1 answer to this question
Recommended Posts