Understanding Authentication methods
In a world where security on the Internet is such a big issue, the need for great authentication methods is something that cannot be missed. Therefore, Zend Framework 2 provides a range of authentication methods that suits everyone's needs.
Getting ready
To make full use of this recipe, I recommend a working Zend Framework 2 skeleton application to be set up.
How to do it…
The following is a list of authentication methods—or as they are called adapters—that are readily available in Zend Framework 2. We will provide a small overview of the adapter, and instructions on how you can use it.
The DbTable adapter
Constructing a DbTable
adapter is pretty easy, if we take a look at the following constructor:
public function __construct( // The Zend\Db\Adapter\Adapter DbAdapter $zendDb, // The table table name to query on $tableName = null, // The column that serves as 'username' $identityColumn = null, // The column that serves as 'password' $credentialColumn...