class Tilia::Dav::Auth::Backend::BasicCallBack

Extremely simply HTTP Basic auth backend.

This backend basically works by calling a callback, which receives a username and password. The callback must return true or false depending on if authentication was correct.

Public Class Methods

new(call_back) click to toggle source

Creates the backend.

A callback must be provided to handle checking the username and password.

@param callable call_back @return void

# File lib/tilia/dav/auth/backend/basic_call_back.rb, line 24
def initialize(call_back)
  super()
  @call_back = call_back
end

Protected Instance Methods

validate_user_pass(username, password) click to toggle source

Validates a username and password

This method should return true or false depending on if login succeeded.

@param string username @param string password @return bool

# File lib/tilia/dav/auth/backend/basic_call_back.rb, line 39
def validate_user_pass(username, password)
  @call_back.call(username, password)
end