Moodle
  1. Moodle
  2. MDL-41733

Allow direct authentication with CAS to a course when multiple authentication is activated

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5.2
    • Fix Version/s: 2.6
    • Component/s: Authentication
    • Labels:
    • Testing Instructions:
      Hide

      Testing prerequisites

      • You need a CAS authentication server configured with two sites, an external one and a moodle one.
      • You also need a CAS account subscribed on a moodle course.

      Testing instructions

      • Go to the external site who need CAS authentication
      • Authenticate yourself with your CAS account
      • on the address bar of your browser, go to your course using this url format:
        https://mymoodle.com/login/index.php?authCAS=CAS&courseid=12345
      • You should be able to access the home page of your course without the need to authenticate yourself again
      • Close all tab and windows on your browser (To kill CAS authentication session)
      • on the address bar of your browser, go to your course using this url format:
        https://mymoodle.com/login/index.php?authCAS=CAS&courseid=12345
      • You should now see the authentication page of your CAS server
      • Enter the authentication information
      • You should now be redirected to the home page of the course entered.
      Show
      Testing prerequisites You need a CAS authentication server configured with two sites, an external one and a moodle one. You also need a CAS account subscribed on a moodle course. Testing instructions Go to the external site who need CAS authentication Authenticate yourself with your CAS account on the address bar of your browser, go to your course using this url format: https://mymoodle.com/login/index.php?authCAS=CAS&courseid=12345 You should be able to access the home page of your course without the need to authenticate yourself again Close all tab and windows on your browser (To kill CAS authentication session) on the address bar of your browser, go to your course using this url format: https://mymoodle.com/login/index.php?authCAS=CAS&courseid=12345 You should now see the authentication page of your CAS server Enter the authentication information You should now be redirected to the home page of the course entered.
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-41733_master
    • Rank:
      52868

      Description

      In the portal of our University a student can connect directly to is course.
      Both the portal and Moodle use the same authentication, CAS.

      The problem is when we activate the Multi-authentication parameters on the CAS server configuration page, the CAS connected users from the portal are always prompted to choose their authentication method. Since they are already connected, we want to force the CAS auth.

      We can choose the auth method from the login url, ex:
      https://mymoodle.myuniversity.com/login/index.php?authCAS=CAS

      it should be nice to have the same for courses ex:
      https://mymoodle.myuniversity.com/course/view.php?id=12345&authCAS=CAS

      After checked in the code, this way needed to modify the code at others place than the CAS auth module so since, its a CAS specific customization, I think we should only modify the code in the auth/CAS/auth.php file.

      So the possible result will look like this:
      https://mymoodle.myuniversity.com/login/index.php?authCAS=CAS&courseid=12345

      I'll share the modification when finished.

        Activity

        Hide
        Gilles-Philippe Leblanc added a comment -

        Here is the code who allow this improvement.

        Show
        Gilles-Philippe Leblanc added a comment - Here is the code who allow this improvement.
        Hide
        Michael de Raadt added a comment -

        Thanks for working on that. Hopefully it will get a review soon.

        Show
        Michael de Raadt added a comment - Thanks for working on that. Hopefully it will get a review soon.
        Hide
        Dan Poltawski added a comment -

        Hi Gilles-Philippe,

        This looks ok to me, the only thing I would say is that it seems more correct to set the default for the courseid to 0 rather than a string of a different type.

        cheers,
        dan

        Show
        Dan Poltawski added a comment - Hi Gilles-Philippe, This looks ok to me, the only thing I would say is that it seems more correct to set the default for the courseid to 0 rather than a string of a different type. cheers, dan
        Hide
        Gilles-Philippe Leblanc added a comment -

        The requested change has been made. Pushing back to request peer review state.

        Show
        Gilles-Philippe Leblanc added a comment - The requested change has been made. Pushing back to request peer review state.
        Hide
        Dan Poltawski added a comment -

        Thanks, sending for integration

        Show
        Dan Poltawski added a comment - Thanks, sending for integration
        Hide
        Marina Glancy added a comment -

        Thanks Gilles-Phillippe, it has been integrated in master

        Show
        Marina Glancy added a comment - Thanks Gilles-Phillippe, it has been integrated in master
        Hide
        Jason Fowler added a comment -

        Thanks for the patch, confirmed to be working as described

        Show
        Jason Fowler added a comment - Thanks for the patch, confirmed to be working as described
        Hide
        Marina Glancy added a comment -

        And THANK YOU again for making Moodle better every day!

        Another weekly release has been released.

        Show
        Marina Glancy added a comment - And THANK YOU again for making Moodle better every day! Another weekly release has been released.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: