Skip to content

Instantly share code, notes, and snippets.

@mscoutermarsh
Created November 27, 2012 00:18
Show Gist options
  • Save mscoutermarsh/4151544 to your computer and use it in GitHub Desktop.
Save mscoutermarsh/4151544 to your computer and use it in GitHub Desktop.
Grape API authentication methods
module API
class Auth < Grape::API
# /api/auth
resource :auth do
#
# auth code goes here!
#
desc "Returns pong if logged in correctly."
params do
requires :token, :type => String, :desc => "Access token."
end
get :ping do
authenticate!
{ :message => "pong" }
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment