require 'sinatra/authorization' class Whatever < Sinatra::Base helpers do include Sinatra::Authorization def authorize(username, password) User.authenticate(username, password) end end get '/something' do require_authorization # Do some other crap end end