Module middleware/basicauth
Basic Authentication middleware.
To apply authentication to parts of your website configure this middleware and call the app's basicauth method with the URI path, user name, digest, and the name of digest's function of the user's password as arguments for each path you want to protect:
Example
app.configure("basicauth");
app.basicauth('/protected/path', 'admin',
'd32b568cd1b96d459e7291ebf4b25d007f275c9f13149beeb782fac0716613f8', 'SHA-256');
Functions
- middleware (next, app)
middleware (next, app)
This middleware installs a basicauth
function in the application object.
If the client request does not provide valid user name and password,
requests will be rejected with a 401 - Unauthorized
response.
Parameters
Function | next | the wrapped middleware chain |
Object | app | the Stick Application object |
Returns
Function | a JSGI middleware function |