Exception: Rack::OAuth2::Server::Resource::Unauthorized

Inherits:
Abstract::Unauthorized show all
Defined in:
lib/rack/oauth2/server/resource/error.rb

Direct Known Subclasses

Bearer::Unauthorized, MAC::Unauthorized

Instance Attribute Summary

Attributes inherited from Abstract::Error

#description, #error, #realm, #status, #uri

Instance Method Summary (collapse)

Methods inherited from Abstract::Unauthorized

#initialize

Methods inherited from Abstract::Error

#initialize, #protocol_params

Constructor Details

This class inherits a constructor from Rack::OAuth2::Server::Abstract::Unauthorized

Instance Method Details

- (Object) finish



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rack/oauth2/server/resource/error.rb', line 13

def finish
  super do |response|
    self.realm ||= DEFAULT_REALM
    header = response.header['WWW-Authenticate'] = "#{scheme} realm=\"#{realm}\""
    if ErrorMethods::DEFAULT_DESCRIPTION.keys.include?(error)
      header << ", error=\"#{error}\""
      header << ", error_description=\"#{description}\"" if description.present?
      header << ", error_uri=\"#{uri}\""                 if uri.present?
    end
  end
end

- (Object) scheme



9
10
11
# File 'lib/rack/oauth2/server/resource/error.rb', line 9

def scheme
  raise 'Define me!'
end