Module: OAuth2::Auth::Server::Authentication::ClassMethods

Defined in:
lib/oauth2-auth-server/authentication.rb

Instance Method Summary collapse

Instance Method Details

#oauth_client_required(options = {}) ⇒ Object



47
48
49
50
51
52
# File 'lib/oauth2-auth-server/authentication.rb', line 47

def oauth_client_required(options = {})
  scope = options.delete(:scope)
  before_filter options do |controller|
    controller.require_oauth_client_token(:scope => scope)
  end
end

#oauth_required(options = {}) ⇒ Object



40
41
42
43
44
45
# File 'lib/oauth2-auth-server/authentication.rb', line 40

def oauth_required(options = {})
  scope = options.delete(:scope)
  before_filter options do |controller|
    controller.require_oauth_token(:scope => scope)
  end
end