Menu

#477 CAS Setup Error

Minor
closed
nobody
1
2020-10-11
2020-08-28
Anonymous
No

MRBS Version 1.9.0

When setting the session and auth types to 'cas', there are a number of errors generated:

  1. CAS Client not setup before use in SessionCas

Error:

Uncaught exception 'CAS_OutOfSequenceBeforeClientException' in /home/user/_repo/mrbs-1.9.0/web/lib/CAS.php at line 1854
this method cannot be called before phpCAS::client() or phpCAS::proxy()
#0 /home/user/_repo/mrbs-1.9.0/web/lib/CAS.php(1162): phpCAS::_validateClientExists()
#1 /home/user/_repo/mrbs-1.9.0/web/lib/MRBS/Session/SessionCas.php(19): phpCAS::isAuthenticated()
#2 /home/user/_repo/mrbs-1.9.0/web/mrbs_auth.inc(156): MRBS\Session\SessionCas->getCurrentUser()
#3 /home/user/_repo/mrbs-1.9.0/web/mrbs_auth.inc(198): MRBS\getAuthorised(1, 'https://reserva...')
#4 /home/user/_repo/mrbs-1.9.0/web/edit_entry.php(1181): MRBS\checkAuthorised('edit_entry.php')
#5 {main}

This happens because web/lib/MRBS/Session/SessionCas.php doesn't set up the phpCAS Client before calling checkAuthentication().

My workaround:

class SessionCas extends SessionWithLogin
{

  public function __construct()
  {
    \MRBS\auth();

    parent::__construct();
  }

If anyone wants access to a CAS server to test, I now have one I can share - let me know.

Discussion

  • Campbell Morrison

    Thanks. Yes please, if you could give me access to a CAS server for testing purposes that would be great. You can send the details by private message.

     
  • Yehuda Katz

    Yehuda Katz - 2020-08-28

    Why does SourceForge never remember that I am logged in right as I post a ticket? Subscribing.

     
  • Campbell Morrison

    Thanks. Now fixed in 64627e.

     
  • Campbell Morrison

    Fixed in MRBS 1.9.1.

     
  • Campbell Morrison

    • status: open --> closed
     
MongoDB Logo MongoDB