Function performBasicAuth
Overload group
Returns a request handler that enforces request to be authenticated using HTTP Basic Auth.
Prototype
HTTPServerRequestDelegate performBasicAuth( string realm, bool delegate(string user, string name) pwcheck );
Overload group
Enforces HTTP Basic Auth authentication on the given req
/res
pair.
Prototype
string performBasicAuth( HTTPServerRequest req, HTTPServerResponse res, string realm, bool delegate(string, string) pwcheck );
Parameters
Name | Description |
---|---|
req | Request object that is to be checked |
res | Response object that will be used for authentication errors |
realm | HTTP Basic Auth realm reported to the client |
pwcheck | A delegate queried for validating user/password pairs |
Returns
Returns the name of the authenticated user.
Throws
Throws a HTTPStatusExeption in case of an authentication failure.
Authors
Sönke Ludwig
Copyright
© 2012 RejectedSoftware e.K.
License
Subject to the terms of the MIT license, as written in the included LICENSE.txt file.