Sha256: 86824bc629ae34bfd6d293e020c809b2c5d3a2e691323798ea6bbb59e6516cea
Contents?: true
Size: 621 Bytes
Versions: 6
Compression:
Stored size: 621 Bytes
Contents
module Restfulness module Resources # Module to support authentication in Restfulness resources. module Authentication # Parse the request headers for HTTP Basic Authentication details and # run the provided block. # If the request does not include and basic headers or the details are invalid, # the block will not be called. def authenticate_with_http_basic header = request.authorization auth = HttpAuthentication::Basic.new(header) if header if auth && auth.valid? yield auth.username, auth.password end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems