I've copied the Google authentication plugin for another API, but for some reason it's not saving records in Joomla. If I manually add the username and some random password, then my plugin does authenticate against the API correctly - but otherwise when trying to login I get the error message: "You cannot access the private section of this site."
I'm not looking for coding help necessarily, I just want to know how the Google authentication plugin is saving the record. I've got through the plugin several times looking for it, but I don't see it. I have to assume it has to do with the $response, but I'm setting each of the values that the google auth is. What's being called to save the record?
EDIT:
Ok, clearly I have no idea how a user is logged on to Joomla. Why doesn't this work??
public function onUserAuthenticate($credentials, $options, &$response) {
// Load plugin language
$this->loadLanguage();
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;
$response->error_message = '';
$response->type = 'Mysite';
$response->email = $credentials['username'];
$response->username = $credentials['username'];
$response->fullname = $credentials['username'];
}
}