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

Web service users should not have to accept site policies

XMLWordPrintable

    • MOODLE_32_STABLE, MOODLE_33_STABLE
    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MDL-60038-401
    • MDL-60038-master
    • Hide
      1. Login as admin.
      2. Go to Site Admin > Users > Policy settings and set a Site policy URL on the policy settings.
      3. Go to Site Admin > General > Advanced features and tick the Enable web services configuration.
      4. Go to Site Admin > Server > Manage protocols and enable REST protocol on the Manage protocols.
      5. Go to Site Admin > Plugins > Manage authentication and enable Web services authentication In the Manage authentication.
      6. Create a new user for webtest, and set "Choose an authentication method" to "Web services authentication".
      7. Create a new course, and note down the COURSE ID from the URL course front page.
      8. Enrol the webtest user on the course. Enrol also another user (for instance, s1).
      9. Go to Site Admin > Server > Manage Tokens and create a new token with the following inputs:
        • User: webtest
        • Service: Mobile mobile web service
      10. Create another token for user s1 (with the same Service)
      11. Note down the TOKEN values
      12. Open a private browser window and call the web service using the following URL:

        WWWROOT/webservice/rest/server.php?wstoken=TOKEN&wsfunction=core_course_get_contents&courseid=COURSE_ID

        Replace WWWROOT with the config you have and TOKEN and COURSE_ID from the previous activities.

      13. Verify when the webtest token is used, it returns the course content owned by the COURSE_ID instead of the 'Site policy not agreed' error message. 
      14. Verify when the s1 token is used, the 'Site policy not agreed' error message is displayed.
      Show
      Login as admin. Go to Site Admin > Users > Policy settings and set a Site policy URL on the policy settings. Go to Site Admin > General > Advanced features and tick the Enable web services configuration. Go to Site Admin > Server > Manage protocols and enable REST protocol on the Manage protocols. Go to Site Admin > Plugins > Manage authentication and enable Web services authentication In the Manage authentication. Create a new user for webtest, and set "Choose an authentication method" to "Web services authentication". Create a new course, and note down the COURSE ID from the URL course front page. Enrol the webtest user on the course. Enrol also another user (for instance, s1). Go to Site Admin > Server > Manage Tokens and create a new token with the following inputs: User: webtest Service: Mobile mobile web service Create another token for user s1 (with the same Service) Note down the TOKEN values Open a private browser window and call the web service using the following URL: WWWROOT/webservice/rest/server.php?wstoken=TOKEN&wsfunction=core_course_get_contents&courseid=COURSE_ID Replace WWWROOT with the config you have and TOKEN and COURSE_ID from the previous activities. Verify when the webtest token is used, it returns the course content owned by the COURSE_ID instead of the 'Site policy not agreed' error message.  Verify when the s1 token is used, the 'Site policy not agreed' error message is displayed.
    • 1
    • Team Hedgehog Sprint 1.3

      I added a site policy to my site today and it broke my webservices because the web service users hadn't agreed to the site policy!

      User accounts which are created solely for the user of webservices should be exempt from this check.

        1. 400.png
          400.png
          244 kB
        2. 401.png
          401.png
          246 kB
        3. Master.png
          Master.png
          246 kB

            Noemie Noemie Ariste
            brudinie guy thomas
            Meirza Meirza
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            2 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 11 minutes
                4h 11m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.