diff --git a/badges/backpackconnect.php b/badges/backpackconnect.php
new file mode 100644
index 0000000..22731c2
--- /dev/null
+++ b/badges/backpackconnect.php
@@ -0,0 +1,33 @@
+<?php
+require_once('../config.php');
+
+$a = required_param('a', PARAM_TEXT);
+
+$url = 'https://verifier.login.persona.org/verify';
+$assert = filter_input(
+    INPUT_POST,
+    'assertion',
+    FILTER_UNSAFE_RAW,
+    FILTER_FLAG_STRIP_LOW|FILTER_FLAG_STRIP_HIGH
+);
+//Use the $_POST superglobal array for PHP < 5.2 and write your own filter
+$params = 'assertion=' . urlencode($a) . '&audience=' .
+           urlencode($CFG->wwwroot);
+$ch = curl_init();
+$options = array(
+    CURLOPT_URL => $url,
+    CURLOPT_RETURNTRANSFER => TRUE,
+    CURLOPT_POST => 2,
+    CURLOPT_POSTFIELDS => $params
+);
+curl_setopt_array($ch, $options);
+$result = curl_exec($ch);
+curl_close($ch);
+
+echo "If the server indicates the assertion was valid with a success response, we can assume they own the backpack linked to the email that is returned and use it as the connection url:";
+
+echo $result;
+
+echo "We should save connection email to the database here, so by the time the user is back on the backpack page it will show up as connected.";
+
+?>
diff --git a/badges/mybackpack.php b/badges/mybackpack.php
index 1f52453..e6b8112 100644
--- a/badges/mybackpack.php
+++ b/badges/mybackpack.php
@@ -129,4 +129,34 @@ if ($backpack) {
 
 echo $OUTPUT->header();
 $form->display();
+echo '<img id="signin" src="https://developer.mozilla.org/files/3961/persona_sign_in_black.png" width="185" height="25"/>';
+echo '<script src="https://login.persona.org/include.js"></script>';
+echo '<script>var signinLink = document.getElementById("signin");
+if (signinLink) {
+      signinLink.onclick = function() { navigator.id.get(gotAssertion); };
+}
+function gotAssertion(assertion) {
+    if (!assertion) {
+        alert("assertion failed");
+        return;
+    }
+    Y.io("backpackconnect.php", {
+        method: "POST",
+        data: "a="+assertion,
+        on: {
+            success: function (id, result) {
+                console.log("success");
+                console.log(result.response);
+                window.location.href = "mybackpack.php";
+            },
+            failure: function (id, result) {
+                console.log("failure");
+                console.log(result.response);
+                // use the flag to post an error on the original page
+                window.location.href = "mybackpack.php?error=1";
+            }
+        }
+    });
+}
+</script>';
 echo $OUTPUT->footer();
