This repository was archived by the owner on Aug 22, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 259
Assertions
Brian J Brennan edited this page Sep 9, 2011
·
32 revisions
In the future we will support signed assertions, which will mean signing a badge assertion with your private key and hosting a public key at a well known, public URL. In the even more distant future, we will probably try to support DNSSEC for public key discovery. For now, we only support Hosted Assertions.
A hosted assertion is a file containing well-formatted JSON served with the
content-type application/json.
In the examples below badge_assertion is a native dictionary, hash
or associative array. badge_assertion_json is a prepared JSON string.
// Do this before doing anything that starts a response
header('Content-Type: application/json');// do not use drupal_json -- it sets the wrong header
drupal_add_http_header('Content-Type', 'application/json');
echo drupal_to_js(badge_assertion);drupal_json_output(badge_assertion);HttpResponse(badge_assertion_json, mimetype='application/json')render :json => badge_assertion# Save your assertions as .json files and add this to your httpd.conf
AddType application/json json# In your server context, add the following:
types {
applications/json json;
}