Download the PHP package nichdu/simple-auth without Composer
On this page you can find all versions of the php package nichdu/simple-auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download nichdu/simple-auth
More information about nichdu/simple-auth
Files in nichdu/simple-auth
Download nichdu/simple-auth
More information about nichdu/simple-auth
Files in nichdu/simple-auth
Vendor nichdu
Package simple-auth
Short Description library for simple single user authentication via secret, random and time stamp
License BSD-4-Clause
Package simple-auth
Short Description library for simple single user authentication via secret, random and time stamp
License BSD-4-Clause
Please rate this library. Is it a good library?
Informations about the package simple-auth
SimpleAuth - a simple PHP authentication library
This is a simple PHP authentication library if you don't want to mess around with user names and passwords.
Usage
Here is a basic usage example:
Setting parameters
Parameter | Method | Explanation |
---|---|---|
Hash algorithm | setHashAlgorithm (instance method) |
Setting the hash algorithm for hash creation and validation. The algorithm must be in hash_algos() . |
Default hash algorithm | setDefaultHashAlgorithm (class method) |
Setting the default hash algorithm. |
Hash rounds | setHashRounds (instance method) |
Setting the number of hash rounds (log 2). |
Default hash rounds | setDefaultHashRounds (class method) |
Setting the default number of hash rounds (log 2). |
Time difference | setTimeDifference (instance method) |
Setting the maximum time difference between creation of the authentication hash and its validation. If the time difference is longer than this value the authentication hash will be rejected. Keep in mind that people could have slow internet connections and wrong system clocks which can influence the hash's time. |
Default time difference | setDefaultTimeDifference (class method) |
Setting the default maximum time difference between creation of the authentication hash and its validation. See above for more information. |
Please note that all default
methods will only influence future instances of Authenticator
. Existing ones will keep their current values.
How does it work?
To create your own authentication hash, you must do the following:
- Use the same secret as the server
- Generate a random string
- Get the current date and time and format as string formatted according to PHP's c-format (ISO 8601)
- Concatenate the random string, the date string, and the secret (in this order, without seperators)
- Run the hash function you set the set number of times (e.g. in default settings: run sha-256 2^10 times.
- The result is the authentication hash.
Todos
- none, currently
All versions of simple-auth with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.4.0
The package nichdu/simple-auth contains the following files
Loading the files please wait ....