WiseLoop PHP REST Services 3.3.1
RESTful web service API framework for PHP
wlAuthHandlerUsernameAndPassword Class Reference
Inheritance diagram for wlAuthHandlerUsernameAndPassword:

Public Member Functions

 __construct ($userName, $password)
 isAuthorized ($request)
 authenticate ($authData)

Private Attributes

 $_userName
 $_password

Detailed Description

WiseLoop wlAuthHandlerUsernameAndPassword class definition
This class is designed to provide security handlers for very simple APIs that needs single user authentication.

Author:
WiseLoop
See also:
wlAuthHandler

See also: Authentication & Authorization


Constructor & Destructor Documentation

__construct ( userName,
password 
)
Parameters:
string$userName
string$password

Member Function Documentation

authenticate ( authData)

This method authenticates a user/password pair against the credentials given in the constructor.

Parameters:
array$authDataan array containing two fields: userName and password
Exceptions:
Exception
Returns:
array the user information consisting of the userName and a timestamp corresponding to the login time.

Reimplemented from wlAuthHandler.

isAuthorized ( request)

This method should be overwritten in the derived classes and describes how to authorize a request.

Parameters:
wlRestRequest$requestthe current request
Returns:
bool

Reimplemented from wlAuthHandler.


Field Documentation

$_password [private]

Type: string the password

$_userName [private]

Type: string the user name

 All Data Structures Functions Variables