Doorkeeper provides helpers for the Grape framework >= 0.10. One of them is
doorkeeper_authorize!that can be used in a similar way as an example above to protect your API with OAuth. Note that you have to use
helpers Doorkeeper::Grape::Helpersin your Grape API class.
class Users < Grape::API
# For old versions of Grape:
# route_setting :scopes, ['user:email']
get :me, scopes: [:user, :read] do
The sample app is a Rails 4 template with everything necessary to create an autodocumented, secured API in Grape with doorkeeper.