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

Openbadges backpack connection broken on Moodle

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      N.b. All steps as admin user.

      Prereqs
      1. Important: Make sure your site is publically accessible (using ngrok : ngrok http --region=au 80)
      2. Make sure you have your outbound email set up in Moodle. You can use something like mailcatcher to view all outbounds easily.
      3. Also make sure you adjust your noreply email address adding a domain, otherwise you'll get debugging errors. noreply@localhost needs to be noreply@localhost.xx.
      4. Make sure you have an account registered on openbadges backpack
      Set up a new connection
      1. Go to Site admin > Badges > Manage badges and create two different badges.
      2. Award the badges to yourself from the Manage badges page.
      3. Confirm that you can see both the assigned badges when you view your profile.
      4. Now, go to Preferences > Backpack settings
      5. You shouldn't have an existing connection to the backpack. If you do, click 'Disconnect'.
      6. Now, enter 'test@example.com' into the email field and click 'Connect to Backpack'
      7. Confirm that you see a validation failure and a message about the email not being registered with the backpack provider. (Regression test).
      8. Now, enter the email address of your Backpack account and click 'Connect'.
      9. Confirm that:
        • You see a notice stating that the verification email has been sent.
        • You see the status listed as 'Verification pending'
        • You see the email address listed, but read only.
      10. Check mailcatcher (or other) and confirm that you see the email.
      11. Click the link in the email (you may need to copy/paste if using mailcatcher)
      12. Confirm that:
        • You are redirected to mypackback and are presented with a success message
        • The status of the connection is 'Connected'
        • The email address is listed but not editable.
      Export a badge
      1. Now, go to Preferences > Manage badges
      2. In another tab, make sure you are disconnected from https://backpack.openbadges.org/. I.e. sign out.
      3. Now, back in Moodle, With the first badge you created earlier, click the 'Add to backpack' icon.
      4. Confirm that you are prompted to sign in to the Backpack
        Note: Don't worry if you see a console error like 'assertion.badge.image not found 404'. This is an external bug. See here
      5. Enter details and click 'Login'.
      6. Confirm that you are now presented with an overview, asking you to accept the badge.
      7. Click 'Yes'.
      8. Confirm that you see a confirmation saying, you've 'sent 1 badge to your backpack'.
      9. Now, back in Moodle, send the second badge to the backpack.
      10. Confirm that you're not asked to log in this time, only asked to accept the badge.
      11. Check your Openbadges backpack in another tab and confirm that you can see the recent badges.
      Importing badges from a collection
      1. Still in the backpack, click 'collections'.
      2. Create a new collection, make it public, and drag the two badges to it.
      3. Now go to Preferences > Backpack settings
      4. Under 'Badge import settings', Confirm that you see the collection you made public just before.
      5. Select the collection and save.
      6. Confirm that:
        • You're redirected to mybadges
        • You see the badge you exported before in both sections (site badges, and badges from other sites).
      Disconnecting
      1. Disconnect from the backpack.
      2. Go to manage badges page.
      3. Confirm that you can't see the backpack badges any more.
      4. Reconnect, going through the verification process again and confirm that the badges are now visible again. You may need to reselect the collection.
      Verification when not logged in
      1. Disconnect from the backpack.
      2. Enter your email again and click 'Connect to backpack'.
      3. Log out of Moodle.
      4. Now, click the link in the email.
      5. Confirm that you're asked to log in.
      6. Log in.
      7. Confirm that:
        • You're redirected to mypackpack
        • You see the success notice
        • The connection is listed as 'Connected'
      Verification cancellation (perhaps a mis-typed email address, etc).
      1. Disconnect from the backpack.
      2. Enter your email and connect.
      3. Instead of checking the verification link in the email, click the 'Connect using a different email address' button.
      4. Confirm that the process is reset.
      5. Now, click the link in the email.
      6. Confirm that you're redirected to the backpack setting page and see no notifications.
      API Unreachable (If, for some reason, the backpack APIs can't be reached during the process of establishing a connection)
      1. Disconnect from any active connection.
      2. Edit your hosts file and create an entry for 'backpack.openbadges.org' pointing to some unreachable address like 255.255.255.255.
      3. Try to connect to the backpack entering your email and clicking 'connect to backpack' - as before.
      4. Confirm that:
        • you see a form validation error stating 'There was a problem contacting the Backpack...etc'
        • No email has been sent.
      5. Now, comment out the hosts entry.
      6. Connect again, and confirm that the verification email is sent. Don't click the link yet.
      7. Now, uncomment the hosts entry again.
      8. Follow the link and Confirm that:
        • You're redirected to mybackpack
        • You see an error message 'There was a problem contacting the Backpack...etc'
      9. Now comment out the hosts entry.
      10. Now, follow the same link again.
      11. Confirm that the connection is created successfully.
      Show
      N.b. All steps as admin user. Prereqs Important: Make sure your site is publically accessible (using ngrok : ngrok http --region=au 80) Make sure you have your outbound email set up in Moodle. You can use something like mailcatcher to view all outbounds easily. Also make sure you adjust your noreply email address adding a domain, otherwise you'll get debugging errors. noreply@localhost needs to be noreply@localhost.xx. Make sure you have an account registered on openbadges backpack Set up a new connection Go to Site admin > Badges > Manage badges and create two different badges. Award the badges to yourself from the Manage badges page. Confirm that you can see both the assigned badges when you view your profile. Now, go to Preferences > Backpack settings You shouldn't have an existing connection to the backpack. If you do, click 'Disconnect'. Now, enter 'test@example.com' into the email field and click 'Connect to Backpack' Confirm that you see a validation failure and a message about the email not being registered with the backpack provider. (Regression test). Now, enter the email address of your Backpack account and click 'Connect'. Confirm that : You see a notice stating that the verification email has been sent. You see the status listed as 'Verification pending' You see the email address listed, but read only. Check mailcatcher (or other) and confirm that you see the email. Click the link in the email (you may need to copy/paste if using mailcatcher) Confirm that : You are redirected to mypackback and are presented with a success message The status of the connection is 'Connected' The email address is listed but not editable. Export a badge Now, go to Preferences > Manage badges In another tab, make sure you are disconnected from https://backpack.openbadges.org/ . I.e. sign out. Now, back in Moodle, With the first badge you created earlier, click the 'Add to backpack' icon. Confirm that you are prompted to sign in to the Backpack Note: Don't worry if you see a console error like 'assertion.badge.image not found 404'. This is an external bug. See here Enter details and click 'Login'. Confirm that you are now presented with an overview, asking you to accept the badge. Click 'Yes'. Confirm that you see a confirmation saying, you've 'sent 1 badge to your backpack'. Now, back in Moodle, send the second badge to the backpack. Confirm that you're not asked to log in this time, only asked to accept the badge. Check your Openbadges backpack in another tab and confirm that you can see the recent badges. Importing badges from a collection Still in the backpack, click 'collections'. Create a new collection, make it public, and drag the two badges to it. Now go to Preferences > Backpack settings Under 'Badge import settings', Confirm that you see the collection you made public just before. Select the collection and save. Confirm that : You're redirected to mybadges You see the badge you exported before in both sections (site badges, and badges from other sites). Disconnecting Disconnect from the backpack. Go to manage badges page. Confirm that you can't see the backpack badges any more. Reconnect, going through the verification process again and confirm that the badges are now visible again. You may need to reselect the collection. Verification when not logged in Disconnect from the backpack. Enter your email again and click 'Connect to backpack'. Log out of Moodle. Now, click the link in the email. Confirm that you're asked to log in. Log in. Confirm that : You're redirected to mypackpack You see the success notice The connection is listed as 'Connected' Verification cancellation (perhaps a mis-typed email address, etc). Disconnect from the backpack. Enter your email and connect. Instead of checking the verification link in the email, click the 'Connect using a different email address' button. Confirm that the process is reset. Now, click the link in the email. Confirm that you're redirected to the backpack setting page and see no notifications. API Unreachable (If, for some reason, the backpack APIs can't be reached during the process of establishing a connection) Disconnect from any active connection. Edit your hosts file and create an entry for 'backpack.openbadges.org' pointing to some unreachable address like 255.255.255.255. Try to connect to the backpack entering your email and clicking 'connect to backpack' - as before. Confirm that : you see a form validation error stating 'There was a problem contacting the Backpack...etc' No email has been sent. Now, comment out the hosts entry. Connect again, and confirm that the verification email is sent. Don't click the link yet. Now, uncomment the hosts entry again. Follow the link and Confirm that : You're redirected to mybackpack You see an error message 'There was a problem contacting the Backpack...etc' Now comment out the hosts entry. Now, follow the same link again. Confirm that the connection is created successfully.
    • Affected Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE, MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-57429-master
    • Sprint:
      3.3 sprint 4

      Description

      Earlier this month, Mozilla shut down the persona service. This results in New backpack connections being unable to authenticate against backpack.openbadges.org.

      The openbadges backpack has been migrated to a new authentication service, but Moodle is still calling the deactivated persona service for login:

      SEE:
      https://github.com/sbourget/moodle/blob/master/badges/backpackconnect.php#L57

      This can be easily reproduced on Moodle.org.
      1. Disconnect from the backpack if you are currently connected.
      2. Try to re-connect. You will get a popup window telling you that the persona service has shut down.

        Attachments

          Activity

            People

            • Votes:
              50 Vote for this issue
              Watchers:
              45 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                8/May/17