Hello,
I develop a plugin to authentifie the user by a CAS but when the user connect this with the CAS, the session isn’t create. The result to the authentification with the CAS is valid, I have control this.
The code is :
$authAdapter = new Omeka_Auth_Adapter_CAS('avignon.php', $recupInfoCAS);
$result = $authAdapter->authenticate();
if ($result->isValid()) {
$session = new Zend_Session_Namespace;
// Zend_Session::forgetMe();
if ($session->redirect) {
$this->_helper->redirector->gotoUrl($session->redirect);
} else {
$this->_helper->redirector->gotoUrl('/admin');
}
}
else {
$this->_helper->redirector->gotoUrl('/');
}
Sorry for the spelling errors, I isn’t good in english.
I have a plugin which supports CAS and LDAP authentication for Omeka Classic available here:
I found in developing the plugin one of the hardest challenges was making sure that Omeka and CAS would not destroy each other’s sessions.
Your code is too brief to see what may be going wrong. Is it within a UserController? If so, you may need to use the Zend_Auth object in $this->_auth to authenticate your adapter so Omeka is aware of the outcome. Line 2 would be:
Hello @kloor,
Sorry for my tardiness.
My plugin have other specification and I prefer use phpCAS for facility and maintainability.
Omeka and the CAS don’t destroy other’s session.
I use a Controller for change this.
The code is accessible at this link https://github.com/MaximeBisotto/Omeka_AuthentificationPlugin
My best guess is that you do need to pass the adapter to $this->_auth->authenticate() so that Omeka can store the result before returning it to your controller. Otherwise, Omeka wont be aware that the user is authenticated, and wont store the redirect into the session.
I need use the filter loginAdapter or not because $result = $this->_auth->authenticate($authAdapter);
don’t use my adapter. I use the login with the CAS at the route ‘/users/cas’ not /users/login’ so I can’t use $adapter = $this->_getAdapter();