Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-40805

user_logout event is not triggered when using CAS authentication with CAS logout option set to yes

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      In order to execute this test, you should have a working CAS Server.

      There's a CAS VM on server to test this.

      Also, to establish connection between your moodle instance and the CAS server, you should change the _getServerBaseURL function on CAS/Client.php. The main reason is because CAS plugin by the default verify the host SSL and unless you have a HTTPS in your local machine, you should change this line.

      1. Replace the https to http on line 301, the line should be exactly like this:

      $this->_server['base_url'] = 'http://' . $this->_getServerHostname();
      

      2. Log as admin and Go to Plugins > Authentication > Manage authentication.
      3. Enable CAS server (SSO) and go to Settings. The config should be like this.

      Hostname: Your VM IP address 
      Base URI: cas-server-webapp-3.5.2/
      Port: 8080
      CAS logout option: Yes
      Multi-authentication: Yes
      

      4. Create a user moodle or cas1 and set the authentication method to: CAS server (SSO)
      5. Logout and click on Log In.
      6. You will be prompted to choose the authentication method, choose CAS user.
      7. Enter your cas user and password and click LOGIN.
      8. You should be redirected to your moodle home.
      9. Click Log out.
      10. You should be redirect to your CAS server logout page.
      11. Log as admin again, and open Reports > Logs
      13. Make sure the logout was generated for the CAS user.

      The user with id 'XX' has logged out.
      

      Test this issue on 2.7 and 2.6 as well.

      Show
      In order to execute this test, you should have a working CAS Server. There's a CAS VM on server to test this. Also, to establish connection between your moodle instance and the CAS server, you should change the _getServerBaseURL function on CAS/Client.php. The main reason is because CAS plugin by the default verify the host SSL and unless you have a HTTPS in your local machine, you should change this line. 1. Replace the https to http on line 301, the line should be exactly like this: $this->_server['base_url'] = 'http://' . $this->_getServerHostname(); 2. Log as admin and Go to Plugins > Authentication > Manage authentication. 3. Enable CAS server (SSO) and go to Settings. The config should be like this. Hostname: Your VM IP address Base URI: cas-server-webapp-3.5.2/ Port: 8080 CAS logout option: Yes Multi-authentication: Yes 4. Create a user moodle or cas1 and set the authentication method to: CAS server (SSO) 5. Logout and click on Log In. 6. You will be prompted to choose the authentication method, choose CAS user. 7. Enter your cas user and password and click LOGIN. 8. You should be redirected to your moodle home. 9. Click Log out. 10. You should be redirect to your CAS server logout page. 11. Log as admin again, and open Reports > Logs 13. Make sure the logout was generated for the CAS user. The user with id 'XX' has logged out. Test this issue on 2.7 and 2.6 as well.
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Epic Link:
    • Pull from Repository:
    • Pull Master Branch:
      MDL-40805-master
    • Story Points:
      40
    • Sprint:
      BACKEND Sprint 13

      Description

      The user_logout event does not get triggered when CAS authentication plugin is enabled AND the "CAS logout option" is set to "yes"

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/Jul/14