class
Orion::Middleware::BasicAuth
- Orion::Middleware::BasicAuth
- Orion::Middleware::Auth
- Reference
- Object
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.crConstructors
Instance Method Summary
-
#authenticate(context : Orion::Server::Context) : Bool
Override this to implement authentication logic
- #credentials : Hash(String, String)
- #credentials=(credentials : Hash(String, String))
- #realm : String
- #realm=(realm : String)
-
#unauthorized_response(context : Orion::Server::Context)
Override to customize unauthorized response
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 unauthorized_response(context : Orion::Server::Context)
#
Description copied from class Orion::Middleware::Auth
Override to customize unauthorized response