Badgr API has changed and badges not displaying anymore

Bug #1988692 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
21.04
Fix Released
High
Unassigned
21.10
Fix Released
High
Unassigned
22.04
Fix Released
High
Unassigned
22.10
Fix Released
High
Robert Lyon

Bug Description

The Badgr API uses a newer token system where the token needs regular refreshing - the current system does not refresh the token.

Need to
- update the API calls to fetch new information with authentication 'Bearer' instead of 'Token'
- record the expiry of the token and the 'refresh_token' value too
- have a cron to refresh tokens with the 'refresh_token' value on a once a day basis but not to refresh all the tokens at once (stagger things)

Robert Lyon (robertl-9)
Changed in mahara:
status: New → In Progress
importance: Undecided → High
milestone: none → 22.10.0
Revision history for this message
Robert Lyon (robertl-9) wrote :

To test:

1) Have a backpack account with Badgr https://badgr.com/backpack/badges
2) Have a badge that is in a collection that is shared to the public
3) Have generated a token for Badgr in your mahara via blocktype/openbadgedisplayer/badgrtoken.php
4) Have added an Open badges block to a page

Robert Lyon (robertl-9)
Changed in mahara:
assignee: nobody → Robert Lyon (robertl-9)
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/c/mahara/+/13127
Committed: https://git.mahara.org/mahara/mahara/commit/fb7ea62d39634c4b61817932f24ca0319d1973b5
Submitter: "Doris Tam <email address hidden>"
Branch: main

commit fb7ea62d39634c4b61817932f24ca0319d1973b5
Author: Robert Lyon <email address hidden>
Date: Thu Sep 1 17:20:19 2022 +1200

Bug 1988692: Fixing badgr API calls

This patch
- updates the API calls
- records the refresh token and the expiry time
- handle refreshing tokens as a cron job

Change-Id: I4c2eb50cda031a107e5f01cda3348a5a23da589b
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "22.04_DEV" branch: https://reviews.mahara.org/c/mahara/+/13200

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "21.10_DEV" branch: https://reviews.mahara.org/c/mahara/+/13201

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "21.04_DEV" branch: https://reviews.mahara.org/c/mahara/+/13202

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/c/mahara/+/13202
Committed: https://git.mahara.org/mahara/mahara/commit/fa90f1f68c9481fcf36c22c02cdcd4c85777494d
Submitter: "Robert Lyon <email address hidden>"
Branch: 21.04_DEV

commit fa90f1f68c9481fcf36c22c02cdcd4c85777494d
Author: Robert Lyon <email address hidden>
Date: Thu Sep 1 17:20:19 2022 +1200

Bug 1988692: Fixing badgr API calls

This patch
- updates the API calls
- records the refresh token and the expiry time
- handle refreshing tokens as a cron job

Change-Id: I4c2eb50cda031a107e5f01cda3348a5a23da589b
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit fb7ea62d39634c4b61817932f24ca0319d1973b5)

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/c/mahara/+/13201
Committed: https://git.mahara.org/mahara/mahara/commit/d6b8cb7a0f29cc58d049219ca84de4c35d73bc96
Submitter: "Robert Lyon <email address hidden>"
Branch: 21.10_DEV

commit d6b8cb7a0f29cc58d049219ca84de4c35d73bc96
Author: Robert Lyon <email address hidden>
Date: Thu Sep 1 17:20:19 2022 +1200

Bug 1988692: Fixing badgr API calls

This patch
- updates the API calls
- records the refresh token and the expiry time
- handle refreshing tokens as a cron job

Change-Id: I4c2eb50cda031a107e5f01cda3348a5a23da589b
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit fb7ea62d39634c4b61817932f24ca0319d1973b5)

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/c/mahara/+/13200
Committed: https://git.mahara.org/mahara/mahara/commit/94f76c778e7179a19b7c46840e0a2eb3199a3c48
Submitter: "Robert Lyon <email address hidden>"
Branch: 22.04_DEV

commit 94f76c778e7179a19b7c46840e0a2eb3199a3c48
Author: Robert Lyon <email address hidden>
Date: Thu Sep 1 17:20:19 2022 +1200

Bug 1988692: Fixing badgr API calls

This patch
- updates the API calls
- records the refresh token and the expiry time
- handle refreshing tokens as a cron job

Change-Id: I4c2eb50cda031a107e5f01cda3348a5a23da589b
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit fb7ea62d39634c4b61817932f24ca0319d1973b5)

no longer affects: mahara
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.