var records = [
    { id: 1, username: 'jack', password: 'secret', displayName: 'Jack', emails: [ { value: 'jack@example.com' } ] }
  , { id: 2, username: 'jill', password: 'birthday', displayName: 'Jill', emails: [ { value: 'jill@example.com' } ] }
];

exports.findByUsername = function(username, cb) {
  process.nextTick(function() {
    for (var i = 0, len = records.length; i < len; i++) {
      var record = records[i];
      if (record.username === username) {
        return cb(null, record);
      }
    }
    return cb(null, null);
  });
}

@@ -1,16 +1,42 @@
+require('dotenv').load()%0A%0A
 var records = %5B%0A
@@ -273,16 +273,360 @@
 %5D %7D%0A%5D;%0A%0A
+if (process.env.shared_secret != null && process.env.shared_secret != undefined) %7B%0A  shared = %7B%0A    id: records.length + 2,%0A    username: process.env.shared_username %7C%7C 'community',%0A    password: process.env.shared_secret,%0A    displayName: 'Community Account',%0A    emails: %5B %7B value: 'community@example.com' %7D %5D%0A  %7D;%0A  records.push(shared);%0A%7D%0A%0A
 exports.
@@ -695,24 +695,72 @@
 unction() %7B%0A
+    var match = null;%0A    var community = null;%0A
     for (var
@@ -890,31 +890,116 @@
     
-return cb(null,
+match = record;%0A        break;%0A      %7D else if (record.username == 'community') %7B%0A        community =
  record
-)
 ;%0A  
@@ -1006,24 +1006,101 @@
     %7D%0A    %7D%0A
+    if (match == null && community != null) %7B%0A      match = community;%0A    %7D%0A
     return c
@@ -1107,20 +1107,21 @@
 b(null, 
-null
+match
 );%0A  %7D);

Support for shared secrets for authentication.