vibe.d beta banner
get vibe.d
0.7.30

performBasicAuth - multiple declarations

  • Function performBasicAuth
  • Function performBasicAuth

Function performBasicAuth

Returns a request handler that enforces request to be authenticated using HTTP Basic Auth.

Prototype

void delegate(scope HTTPServerRequest, scope HTTPServerResponse) performBasicAuth(
  string realm,
  bool delegate(string, string) pwcheck
);

Function performBasicAuth

Enforces HTTP Basic Auth authentication on the given req/res pair.

Prototype

string performBasicAuth(
  scope HTTPServerRequest req,
  scope HTTPServerResponse res,
  string realm,
  scope bool delegate(string, string) pwcheck
);

Parameters

NameDescription
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.