Arena
1.0
A content management system
|
This file defines and implements a user authentication engine, which is a subclass of AViewpoint that handles user authentication (logins). More...
Classes | |
class | Plugins.Application.Arena.UserAuthentication.AnAuthenticationError |
Represents an error that might occur within the authentication module itself. More... | |
class | Plugins.Application.Arena.UserAuthentication.AUserAuthenticator |
A user authentication engine, which authenticates users. More... | |
This file defines and implements a user authentication engine, which is a subclass of AViewpoint that handles user authentication (logins).
This engine requires the following query parameters:
username
: The name of the user to be authenticatedpwd
: The hashed value of the user password, which will be compared to the hashed value stored in the user record. In the future, this value will be hashed using a secure token known only to the server and the client. There is an additional, optional query parameter:logout
: This query parameter is used to clear user credentials from the current session; as a result, the session becomes an anonymous one again, with the limited privileges associated therewith. It is worth noting that this query parameter, if provided, negates all others: you cannot use it with /p username or /p pwd, as it will clear the results of the login process and force the user to begin again at step one (entering a username).For security purposes, this engine is presently set up such that logging in with it is a two-step process; this is done on purpose to help prevent brute-force attacks. The engine will NOT accept both the user name and password query parameters at the same time. Additionally, the password-entry view is designed, by default, to require a three-word passphrase rather than a single password; this helps to prevent dictionary-based attacks from being successful, as the complexity of a three-word passphrase is enough to prevent modern computers (as of 2013) from easily cracking the passphrase.
At present, this engine also validates the client's User Agent, to ensure that it does not change between the time the user name is entered and the the time that the password is entered. This is not the greatest guarantor of security, but...
The views used by this engine are designed with the assumption that the user name is provided by an AJAX request, while the final password step is submitted as a regular browser request. This can be changed to suit the needs of your site without changing the code; one needs only to change the associated views.
In the future, AJAX will be used to hash the passphrase using a random secure token that is known only to the server (and which is calculated by the client). If the user enters the token into their browser incorrectly, it will be hashed incorrectly, and authentication will fail. This token is randomly generated each time it is requested, thus preventing passwords from being easily cracked.