AuthStrategyInterface

Extends

Interface AuthStrategyInterface

category

System

package

Authentication

subpackage

Interfaces

Methods

Generates a hash by given password string.

getHash(\StringType $password) : string
Throws
\RuntimeException

if password_hash() could not create a hash.

Arguments

$password

\StringType

String that should be hashed.

Response

string

Resulting hash.

Returns a rehashed password hash if it does not match the currently used hashing algorithm.

getRehashedPassword(\StringType $password, \NonEmptyStringType $hash, \AuthStrategyCollection|null $authStrategyCollection = null) : string

Arguments

$password

\StringType

Password that should be rehashed by a new algorithm.

$hash

\NonEmptyStringType

Current password hash.

$authStrategyCollection

\AuthStrategyCollection|null

Collection of hashing algorithms.

Response

string

The new password hash.

Verifies a given password by its stored hash from the current hashing algorithm.

verify(\StringType $password, \NonEmptyStringType $hash, \AuthStrategyCollection $authStrategyCollection = null) : boolean

Arguments

$password

\StringType

$authStrategyCollection

\AuthStrategyCollection

Response

boolean

Is the password valid?