class Rack::Auth::AbstractHandler - rack-1.6.1 Documentation

# class Rack::Auth::AbstractHandler

Rack::Auth::AbstractHandler implements common authentication functionality.

`realm` should be set for all handlers.

### Attributes

realm[RW]

### Public Class Methods

new(app, realm=nil, &authenticator) click to toggle source

    # File lib/rack/auth/abstract/handler.rb, line 11
    def initialize(app, realm=nil, &authenticator)
      @app, @realm, @authenticator = app, realm, authenticator
    end

### Private Instance Methods

bad_request() click to toggle source

    # File lib/rack/auth/abstract/handler.rb, line 27
    def bad_request
      return [ 400,
        { CONTENT_TYPE => 'text/plain',
          CONTENT_LENGTH => '0' },
        []
      ]
    end

unauthorized(www_authenticate = challenge) click to toggle source

    # File lib/rack/auth/abstract/handler.rb, line 18
    def unauthorized(www_authenticate = challenge)
      return [ 401,
        { CONTENT_TYPE => 'text/plain',
          CONTENT_LENGTH => '0',
          'WWW-Authenticate' => www_authenticate.to_s },
        []
      ]
    end