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

PoC to reorganise backpack_api, to support several versions

XMLWordPrintable

    • MOODLE_500_STABLE
    • MDL-83906-main
    • Hide

      Requirements

      1. Run your site with public access and HTTPS (use ngrok or similar).
      2. Outgoing server configured (mailcacher or similar).
      3. One account on https://badgr.com/
      4. Valid IMS account to access https://certification.imsglobal.org/certification/badgeconnect/launch.html

      Setup

      1. Login as admin.
      2. Create user (s1) and set the Moodle email to match the email for the badgr.com account.
      3. Create the “badgeuser1” user:
        • Username: badgeuser1
        • First name: Badge User1
        • Surname: IMS
        • Email: badgeuser1@imsglobal.org  
      4. Create a badge, publish it and award it to the s1 and badgeuser1 users.
      5. Logout.

      Testing scenario 1. OBv2.0 (using Badgr)

      1. Login as s1.
      2. Go to the user preferences page.
      3. Access to "Backpack settings".
      4. Select "https://badgr.io" from the list and connect using the user account in Badgr.com.
      5. Open the verification email and open the URL to validate the account.
      6. Confirm status is set to Connected.
      7. Go to the user profile page and access the badge you've been awarded.
      8. Click the "Add to backpack" button.
      9. Check the message "Added badge to backpack " is displayed.
      10. Go to the user profile.
      11. Download the badge.
      12. Check that no errors are displayed after uploading it to the following URL (it validates the format): https://openbadgesvalidator.imsglobal.org/ 

       

      Testing scenario 2. OBv2.1 (using IMS Global)

      IMPORTANT: If at any point you need to restart the process, you’ll need to click the “Restart Testing” button and logout and login the admin user. Apart from that, you'll also need to remove the oAuth service and the backpack (before creating them again).

      NOTE: If you haven't a valid IMS account, ping me (Sara) and I'll restart the process on your behalf and will share with you the results

      1. Access to using a valid IMS account: https://certification.imsglobal.org/certification/badgeconnect/launch.html 
      2. Read the information and press the “Get Started” button.
      3. Review your information (name, email address and organization) and “Confirm” it.
      4. Select the Moodle version (you can select 5.0).
      5. Select the “Service Consumer (Write)”, which is the one implemented by Moodle.
      6. Read the testing instructions and save the information (some data will be used later, such as the base API URL or the password for badgeuser1).
      7. Click the “Done” button and keep the “Auto-registration” window open, to confirm the certification process is working as expected.
      8. Login as admin to your Moodle site.
      9. Go to "Site administration > Badges > Manage backpacks".
      10. Create a new backpack with the following information:
      11. Go to "Site administration > Server > OAuth 2 services".
      12. In the “IMS Global Badge Connect Validator“ tab, check that “Get manifest” and “Do Auto-Registration” have been executed.
      13. Check a new OAuth service "1EdTech Badge Host" has been created.
      14. Go to the Configure endpoints page for this issuer.
      15. Check "apiBase" is one of the endpoints displayed.
      16. Login as badgeuser1
      17. Go to the user preferences page.
      18. Access to "Backpack settings".
      19. Select "https://certification.imsglobal.org/badgeconnect" from the list and click the “Connect to backpack” button. You should be redirected to the login page for the IMS Global backpack service.
      20. Use the credentials for badgeuser1 defined in the “IMS Global Badge Connect Validator” page (right now they are “badgeuser1” / “user1rocks”). You can use the username instead of email.
      21. Accept the terms and conditions displayed.
      22. Check " Backpack is connected" is displayed.
      23. In the “IMS Global Badge Connect Validator“ tab, check that “Do Authorization Grant” and “Retrieve OAuth2 Token” have been executed too.
      24. Go to the user profile page and access the badge you've been awarded.
      25. Click the "Add to backpack" button.
      26. Check the message "Added badge to backpack " is displayed.
      27. In the “IMS Global Badge Connect Validator“ tab, check that “POST Assertion ” has been executed too.
      Show
      Requirements Run your site with public access and HTTPS (use ngrok or similar). Outgoing server configured (mailcacher or similar). One account on  https://badgr.com/ Valid IMS account to access  https://certification.imsglobal.org/certification/badgeconnect/launch.html Setup Login as admin. Create user (s1) and set the Moodle email to match the email for the badgr.com account. Create the “badgeuser1” user: Username: badgeuser1 First name: Badge User1 Surname: IMS Email: badgeuser1@imsglobal.org   Create a badge, publish it and award it to the s1 and badgeuser1 users. Logout. Testing scenario 1. OBv2.0 (using Badgr) Login as s1. Go to the user preferences page. Access to "Backpack settings". Select "https://badgr.io" from the list and connect using the user account in Badgr.com. Open the verification email and open the URL to validate the account. Confirm  status is set to Connected. Go to the user profile page and access the badge you've been awarded. Click the "Add to backpack" button. Check  the message "Added badge to backpack " is displayed. Go to the user profile. Download the badge. Check that no errors are displayed after uploading it to the following URL (it validates the format): https://openbadgesvalidator.imsglobal.org/     Testing scenario 2. OBv2.1 (using IMS Global) IMPORTANT : If at any point you need to restart the process, you’ll need to click the “Restart Testing” button and logout and login the admin user. Apart from that, you'll also need to remove the oAuth service and the backpack (before creating them again). NOTE : If you haven't a valid IMS account, ping me (Sara) and I'll restart the process on your behalf and will share with you the results Access to using a valid IMS account:  https://certification.imsglobal.org/certification/badgeconnect/launch.html   Read the information and press the “Get Started” button. Review your information (name, email address and organization) and “Confirm” it. Select the Moodle version (you can select 5.0). Select the “Service Consumer (Write)”, which is the one implemented by Moodle. Read the testing instructions and save the information (some data will be used later, such as the base API URL or the password for badgeuser1). Click the “Done” button and keep the “Auto-registration” window open, to confirm the certification process is working as expected. Login as admin to your Moodle site. Go to "Site administration > Badges > Manage backpacks". Create a new backpack with the following information: API version supported: Open Badges v2.1 Backpack URL:  https://certification.imsglobal.org/badgeconnect   Go to "Site administration > Server > OAuth 2 services". In the “IMS Global Badge Connect Validator“ tab,  check  that “Get manifest” and “Do Auto-Registration” have been executed. Check  a new OAuth service "1EdTech Badge Host" has been created. Go to the Configure endpoints page for this issuer. Check  "apiBase" is one of the endpoints displayed. Login as badgeuser1 Go to the user preferences page. Access to "Backpack settings". Select "https://certification.imsglobal.org/badgeconnect" from the list and click the “Connect to backpack” button. You should be redirected to the login page for the IMS Global backpack service. Use the credentials for badgeuser1 defined in the “IMS Global Badge Connect Validator” page (right now they are “badgeuser1” / “user1rocks”). You can use the username instead of email. Accept the terms and conditions displayed. Check  " Backpack is connected" is displayed. In the “IMS Global Badge Connect Validator“ tab,  check  that “Do Authorization Grant” and “Retrieve OAuth2 Token” have been executed too. Go to the user profile page and access the badge you've been awarded. Click the "Add to backpack" button. Check  the message "Added badge to backpack " is displayed. In the “IMS Global Badge Connect Validator“ tab,  check that “POST Assertion ” has been executed too.
    • Show
      Fails against automated checks. Checked MDL-83906 using repository: https://github.com/sarjona/moodle.git main (142 errors / 46 warnings) [branch: MDL-83906-main | CI Job ] overview (0/0) , phplint (0/0) , phpcs (131/45) , js (0/0) , css (0/0) , phpdoc (8/0) , commit (3/1) , savepoint (0/0) , thirdparty (0/0) , externalbackup (0/0) , grunt (0/0) , shifter (0/0) , mustache (0/0) , gherkin (0/0) , Should these errors be fixed? Built on: Thu May 29 14:56:27 UTC 2025
    • HQ 2025 Sprint I2.1 Moppies

      The backpack_api and backpack_api_mapping are kind of duplicated for OBv2.0 and OBv2.1 (instead of having some generic classes for them). Before adding the implementation for OBv3.0, it would be good to create a generic class for them:

      • badges/classes/backpack_api.php
      • badges/classes/backpack_api_mapping.php
      • badges/classes/backpack_api2p1.php
      • badges/classes/backpack_api2p1_mapping.php

       

      The goal of this task is to investigate and prepare a proof of concept of the best way to reorganise this part, to support several OB versions.

            sarjona Sara Arjona (@sarjona)
            sarjona Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 weeks, 5 hours, 6 minutes
                2w 5h 6m

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