Challenge Overview
Challenge Overview
An Open Badge is a digital representation of a skill or achievement. Each badge awarded to an earner comprises a digital image file and some metadata. The metadata describes what the badge represents, the identity of the earner and the issuing organization.
The CredentialME App will allow you to earn, manage, share, build and consume digital badges and credentials for skills and achievements. In other words, CredentialME is a badge wallet, where you can see and manage your badges. For this first release, we will accept badges from Mozilla and Pearson.
We have implemented the backend and Credly API access, in this challenge we will merge the Credly code(check challenge spec here) and explore the Acclaim API to sign in, query badges and synchronize to our database(Cloudant).
Task Overview
First, Merge Code of Credly to backend
Second, Acclaim
for Acclaim, "badge template"(or badge class) is a badge prototype(similar as "Badge" in our db), while "badge" is the one when the badge template is issued to some user(similar as "BadgeAssertion" in out db))
We will use two kinds of API: OAuth API and Issuer API (they have different authorization)
to access OAuth API, you have to access API of host https://www.youracclaim.com ,setting value of "Authorization" header to be "Basic {access_token}" (described in following sections)
to access Issuer API, you have to access API of host https://sandbox.youracclaim.com, setting value of "Authorization" header to be "Basic em4wSWc3dTZiYS10NG1Gb0RjbTU="
organization_id is 7f2a0a74-64fa-4138-b12b-06f986fd6b30
1. OAuth signIn
1) signIn(we have wrap the OAuth in a stub service located at credential-me.mybluemix.net)
POST /api/v1/acclaim/signIn
TODO
redirect to https://www.youracclaim.com/oauth/authorize?client_id=5961d3559c30aa68407ee6c2e713e0bd63f01944ed4d84dad9f930dbbce7e703&redirect_uri=https://credential-me.mybluemix.net/acclaim/oauthcallback&response_type=code&state=
you have to set the value of "state" with your own callback URL ({host}/api/v1/acclaim/signInCallback)
2)
GET /api/v1/acclaim/signInCallback
params: access_token, expires_in, created_at
TODO
save "access_token" to User.acclaim.accessToken
("expires_in" + "created_at") to User.acclaim.tokenExpiresAt
2. sync organization's badges
TODO
POST /api/v1/acclaim/sync/org/badges
use the Issuer API `GET /organizations/<organization_id>/badge_templates` (https://www.youracclaim.com/docs/badge_templates) to query all the badge templates,
save or update to Badge records in our database(additional field: please store the "recommendations" too)
notice: please wrapper the server method properly, we may call from scheduled job later
3. sync user's badges.
POST /api/v1/acclaim/sync/user/badges
TODO
for BadgeAssertion, we need additional fields:
"uid" : number, Unique Identifier for the badge assertion. This is expected to be locally unique on a per-origin basis, not globally unique.
"pending": bool, whether it is pending
use the OAuth API GET `/oauth/v1/users/self/badges` (https://www.youracclaim.com/docs/oauth) to query the user's public badges
then use the Issuer API GEt `GET /organizations/<organization_id>/badges` (https://www.youracclaim.com/docs/issued_badges) to query the user's pending badges with filter
insert or update BadgeAssertion records in our database.
insert or update Badge records in our database.
4. accept or reject user's pending badges
POST /api/v1/badge/:id/accept
POST /api/v1/badge/:id/reject
TODO
:id is the ObjectId of BadgeAssertion
query BadgeAssertion and Badge, if the badge assertion is pending and the origin is from Acclaim, then use the OAuth API PUT `/oauth/v1//users/self/badges/<badge_id>/accept` and PUT `/oauth/v1/users/self/badges/<badge_id>/reject` to accept or reject pending badge
<badge_id> is stored as the "uid" of BadgeAssertion
Technical Stack
-Nodejs
-IBM Bluemix
Final Submission Guidelines
- Updated backend(Nodejs app code) that could be deployed to Bluemix.
- Updated REST API doc(merge updated API in Credly too).
- A complete and detailed deployment documented explaining how to deploy and verify the app including configuration information. Please provide step by step verification steps, simple text ReadMe is not acceptable.