class Orion::Middleware::BasicAuth

Overview

Basic HTTP Authentication Validates username/password via Basic auth

Usage: use Orion::Middleware::BasicAuth.new( realm: "Admin Area", credentials: {"admin" => "password123"} )

Defined in:

orion/middleware/auth.cr

Constructors

Instance Method Summary

Instance methods inherited from class Orion::Middleware::Auth

authenticate(context : Orion::Server::Context) : Bool authenticate, call(context : HTTP::Server::Context) call, unauthorized_response(context : Orion::Server::Context) unauthorized_response

Constructor Detail

def self.new(realm : String = "Restricted Area", credentials : Hash(String, String) = {} of String => String) #

Instance Method Detail

def authenticate(context : Orion::Server::Context) : Bool #
Description copied from class Orion::Middleware::Auth

Override this to implement authentication logic


def credentials : Hash(String, String) #

def credentials=(credentials : Hash(String, String)) #

def realm : String #

def realm=(realm : String) #

def unauthorized_response(context : Orion::Server::Context) #
Description copied from class Orion::Middleware::Auth

Override to customize unauthorized response