Skip to content

Instantly share code, notes, and snippets.

View pdarche's full-sized avatar

Peter Darche pdarche

  • Abnormal Security
  • San Francisco, CA
View GitHub Profile
@pdarche
pdarche / open paths oauth2 sinatra implementation
Created July 28, 2012 20:27
This is a Sinatra route that handles authentication and access to the open paths api using the oauth2 gem
get '/op' do
consumer_key = 'key'
consumer_secret = 'secret'
url = 'https://openpaths.cc/'
now = Time.now
#instantiate client
client = OAuth2::Client.new(consumer_key, consumer_secret, :site => url)
#create token