-
Notifications
You must be signed in to change notification settings - Fork 259
Assertion Specification Changes
With the 1.0 release of the OBI, the new assertion specification has been implemented. Details about the specification and implementation can be found on the assertions page.
Allow image fields to be data URLs, so it's one less thing for the issuer to host. This also prevents against 404s.
"badge" and "issuer" shouldn't have to be repeated for every badge. By separating those from the main assertion we also reduce problems associated with mutability – for example, the issuer should be able to add new tags to the badge that A) apply retroactively to all previous badges issued, and B) don't require modifying the per-user assertion.
By normalizing out the "badge" and "issuer" information, discovery becomes easier. If the issuer exposes all of the badge JSON objects, we are much closer to being able to spider that information to get a directory of all of the badges an issuer offers.
This adds a verify structure to the assertion, which allows for a
"signed" type, and a URL for public key discovery. Normalization also
allows us to sign just the data that's relevant to a badge instance.
Email is a great identifier because it's inherently federated and
relatively easy to verify, but we'd like to support alternative types of
identification (IndieAuth for example). By
making recipient an object that describes the user identity, with an
explicit type field, we open up the possibility of supporting future
identity systems.
The previous assertion A) only supported hosted assertions and B) did not include the URL for the assertion in the structure itself. This required the assertion URL to be passed around out of band with the assertion itself, making verification more difficult.
A general rule for detecting whether an assertion is the v0.5.0 (old) assertion is:
If badge is a URL, it's the version described by this document. If it's an object, it's the old version. Anything else is invalid.
Rules for a transforming a v0.5.0 assertion to the version described in this document:
BadgeAssertion
-
recipientis an object-
identityis the originalrecipientvalue -
typeis "email" -
saltis found at the root level -
hashedis determined by whether or notidentityhas an "@" character in it.
-
-
issued_onshould be treated asissuedOn -
imageshould be the image frombadge.image - BadgeClass data is contained directly in the
badgeobject - All unqualified URLs should be qualified with the value in
badge.issuer.origin -
verifyis an object-
typeis hosted -
urlshould have been received with the assertion.
-
BadgeClass
- All unqualified URLs should be qualified with the value in
badge.issuer.origin - Drop
versionfield - IssuerOrganization data is contained in
badge.issuer
IssuerOrganization
-
originshould be treated asurl -
contactshould be treated asemail -
nameshould be the concatenation of the originalname, a colon (":") and the originalorg.
Original
{
"recipient": "sha256$2ad891a61112bb953171416acc9cfe2484d59a45a3ed574a1ca93b47d07629fe",
"salt": "hashbrowns",
"evidence": "/badges/html5-basic/bimmy",
"expires": "2013-06-01",
"issued_on": "2011-06-01",
"badge": {
"version": "0.5.0",
"name": "HTML5 Fundamental",
"image": "/img/html5-basic.png",
"description": "Knows the difference between a <section> and an <article>",
"criteria": "/badges/html5-basic",
"issuer": {
"origin": "http://p2pu.org",
"name": "P2PU",
"org": "Mechanical MOOC",
"contact": "admin@p2pu.org"
}
}
}BadgeAssertion
{
"recipient": {
"type": "email",
"hashed": true,
"salt": "hashbrowns",
"identity": "sha256$2ad891a61112bb953171416acc9cfe2484d59a45a3ed574a1ca93b47d07629fe"
},
"badge": <url-of-badgeclass>,
"evidence": "http://p2pu.org/badges/html5-basic/bimmy",
"expires": "2013-06-01",
"issuedOn": "2011-06-01",
"verify": {
"type": "hosted",
"url": <received-with-assertion>
},
}BadgeClass
{
"name": "HTML5 Fundamental",
"image": "http://p2pu.org/badges/img/html5-basic.png",
"description": "Knows the difference between a <section> and an <article>",
"criteria": "http://p2pu.org/badges/html5-basic",
"issuer": <url-of-issuerorganization>
}IssuerOrganization
{
"name": "P2PU: Mechanical MOOC",
"url": "http://p2pu.org",
"email": "admin@p2pu.org"
}