Badges/StepxStep: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 105: Line 105:


== Step 3: Creating your site ==
== Step 3: Creating your site ==
This step is going to be the first that requires some actual coding and system admin type tasks. During this step-by-step guide we are mostly covering what you need to know to issue a badge manually. More automated approaches that include integrating with existing LMS (Moodle) or application frameworks (Drupal, Wordpress, Django, Etc.) will come in a subsequent step-by-step guide.
=== Basic Requirements ===
=== Basic Requirements ===
==== Stability in the URL ====
The resources here are going to keep things as simple as possible. As with many things technical they can quickly become much larger topics as technologies are built upon each other and discussing lower levels can easily become a part of the discussion. For the time being we are going to stay at the higher levels and loop around to dive deeper as the Open Badges project gets to its 1.0 release sometime in early 2013.
==== Basic web site with the ability to support the json content type ====
==== 1. Stability in the URL ====
==== Ability to hash the earners email with the salt ====
Having a stable URL is going to be important for being an issuer. The meta-data within the badge (or json file) needs to refer back to an internet domain name. This is so the badge can be validated and the data within the [https://github.com/mozilla/openbadges/wiki/Assertions origin, criteria, and evidence] can be viewed and referenced through time.
 
==== 2. Basic web site with the ability to support the json content type ====
For manual issue of a badge your web server is going to have to support the '''application/json''' content-type. Ihis is done by some administrative tasks with your servers configuration. A Google search of your server name (Apache, IIS, etc.) and the keyword '''content-type''' should provide the information regarding your server recognizing this content-type.
<pre>
  # Save your manual badge issuing as .json files and add this to your httpd.conf
  AddType  application/json  json
</pre>
'''''Note:''' setting the content-type can also be done in code. This is currently beyond the scope of this step-by-step guide. To review this 'in code' approach feel free to read the github page discussing assetions; https://github.com/mozilla/openbadges/wiki/Assertions''
 
==== 3. Ability to hash the earners email with the salt ====
There is currently two approaches to manually issuing a badge to the OBI backpack. These have been referenced in a number of blog posts mentioned above and in step 0 of this step-by-step guide.
* One method is to make an http request with the correctly formatted json file as a part of the URL (provide example).
<pre>
http://beta.openbadges.org/baker?assertion=http://yourhosting.com/u/folder/BillyBlogTestBadge2.json
</pre>
* the second method is to submit the json file using a javascript call (remember you will need to include the correct javascript library).
<pre>
<a href="javascript:OpenBadges.issue(['http://badges.bit.bc.ca/mwa/mwa-pjrch01.json'], function(errors, successes)
{  });">claim your badge.</a>
</pre>
One of the issues with the plain text nature of json files and massages is that private information can be exposed. One of the features of the OBI is its ability to recognize hashed text to confirm the earner without having to expose their email address in the json file. The following php code snippet hashes the earners email with a salt value using sha256 encryption and echo's (displays) the hashed value to the screen. This is a one way hash, so you can't "unhash" it. To confirm this value you would need the email address of the earner and the salt value and then hash it yourself with sha256. Once the value is hashed you should have no reason to "unhash" the value, the OBI will be able to do this as it is accepting the badge into the earners backpack.
<pre>
<?php
    echo hash("sha256", "peter@example.com"."mwach01");
?>
</pre>


== Step 4: Issuing a badge ==
== Step 4: Issuing a badge ==
1,065

edits

Navigation menu