Skip to content

Instantly share code, notes, and snippets.

@johnnyhalife
Created February 20, 2010 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnnyhalife/309717 to your computer and use it in GitHub Desktop.
Save johnnyhalife/309717 to your computer and use it in GitHub Desktop.
Rack::Auth::WRAP protected resource sample
require 'rubygems'
require 'sinatra'
require 'rack/auth/wrap'
use Rack::Auth::WRAP, :shared_secret => "NjkzNTczOTAtMDA2MC0wMTJkLTQ1M2YtMDAyMzMyYjFmYWY4\n",
:audiences => "http://localhost:4567",
:trusted_issuers => "urn:demo-issuer"
get "/" do
if @env["REMOTE_USER"]
return "You are authenticated as #{@env["REMOTE_USER"]['Email']}"
else
return "You are an unauthenticated user"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment