Documentation

AuthInterface
in

Auth interface

Tags
category

Pop

author

Nick Sagona, III nick@popphp.org

copyright

Copyright (c) 2009-2026 Nick Sagona, III

license

https://www.popphp.org/license New BSD License

version
5.0.0

Table of Contents

Methods

authenticate()  : int
Method to authenticate
getPassword()  : string|null
Get the password
getResult()  : int
Get the authentication result
getUsername()  : string|null
Get the username
isAuthenticated()  : bool
Determine if the authentication attempt was successful
needsRehash()  : bool
Determine if the last verified hash should be rehashed
setPassword()  : AuthInterface
Set the password
setUsername()  : AuthInterface
Set the username
verify()  : bool
Method to verify a password against a hash

Methods

authenticate()

Method to authenticate

public authenticate(string $credential[, string|null $secondary = null ]) : int
Parameters
$credential : string
$secondary : string|null = null
Tags
throws
Exception
Return values
int

getPassword()

Get the password

public getPassword() : string|null
Return values
string|null

getResult()

Get the authentication result

public getResult() : int
Return values
int

getUsername()

Get the username

public getUsername() : string|null
Return values
string|null

isAuthenticated()

Determine if the authentication attempt was successful

public isAuthenticated() : bool
Return values
bool

needsRehash()

Determine if the last verified hash should be rehashed

public needsRehash() : bool
Return values
bool

verify()

Method to verify a password against a hash

public verify(string $password, string $hash) : bool
Parameters
$password : string
$hash : string
Return values
bool

        
On this page

Search results