Skip to content

Instantly share code, notes, and snippets.

@kbuckler
Created September 7, 2011 23:40
Show Gist options
  • Save kbuckler/1202175 to your computer and use it in GitHub Desktop.
Save kbuckler/1202175 to your computer and use it in GitHub Desktop.
Dead simple remote auth server
require 'rubygems'
require 'sinatra'
get '/auth' do
name = "Kenny"
email = "kenny@zendesk.com"
token = ""
remote_photo_url = "http://blog.earthandpawtotems.com/wp-content/uploads/2011/04/honeybadger.jpg"
timestamp = params[:timestamp]
hash = Digest::MD5.hexdigest( name + email + remote_photo_url + token + timestamp )
redirect params[:return_to] + "?name=#{name}&email=#{email}&hash=#{hash}&timestamp=#{timestamp}&remote_photo_url=#{remote_photo_url}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment