Skip to content

Instantly share code, notes, and snippets.

View jaredhanson's full-sized avatar

Jared Hanson jaredhanson

View GitHub Profile
@jaredhanson
jaredhanson / gist:3989193
Created October 31, 2012 19:13
Node Knockout 2012 - Getting Started with Passport
var express = require('express'),
passport = require('passport'),
TwitterStrategy = require('passport-twitter').Strategy,
ensureLoggedIn = require('connect-ensure-login').ensureLoggedIn,
app = express();
app.use(express.static(__dirname + '/public'));
app.use(express.cookieParser());
app.use(express.session({ secret: 'keyboard cat' }));
app.use(passport.initialize());
Verifying my Blockstack ID is secured with the address 1ASvMCiQpDzZ63crdCkgTUPCdfHjqbd65U https://explorer.blockstack.org/address/1ASvMCiQpDzZ63crdCkgTUPCdfHjqbd65U

Keybase proof

I hereby claim:

  • I am jaredhanson on github.
  • I am jaredhanson (https://keybase.io/jaredhanson) on keybase.
  • I have a public key whose fingerprint is 422C F645 48FD 1733 CBFA D7F9 8949 87C2 FD3C D2A2

To claim this, I am signing this object:

@jaredhanson
jaredhanson / gist:2559730
Created April 30, 2012 16:20
Restify and Passport /cc Hal Robertson
// Based off example code from Hal Robertson
// https://github.com/halrobertson/test-restify-passport-facebook
// See discussion: https://groups.google.com/forum/?fromgroups#!topic/passportjs/zCz0nXB_gao
var restify = require('restify')
// config vars
var FB_LOGIN_PATH = '/api/facebook_login'
var FB_CALLBACK_PATH = '/api/facebook_callback'
var FB_APPID = '<<YOUR APPID HERE>>'
@jaredhanson
jaredhanson / gist:3854950
Created October 8, 2012 21:00
Sketch RelMeAuth strategy for Passport
// mapping relmeauth provider support to local URLs for initiating
// authentication, using OAuth, OAuth 2.0, or just about anything else
passport.use(new RelmeStrategy({
'twitter.com': '/auth/twitter'
'facebook.com': '/auth/facebook'
},
function(token, profile, done) {
// relme auth is mostly a discovery mechanism, which redirects
// the the highest-priority, supported provider. The verify
// callback would likely be handled best by the configured
@jaredhanson
jaredhanson / gist:e7a43b66d495fbe4012e
Created August 22, 2014 15:32
OneName Verification
Verifying that +jaredhanson is my Bitcoin username. You can send me #bitcoin here: https://onename.io/jaredhanson