PHP Interface RESTfulAPI_Authenticator

Author: Thierry Francois @colymba [email protected]
Show file Open project: colymba/silverstripe-restfulapi Interface Usage Examples

Public Methods

Method Description
authenticate ( SS_HTTPRequest $request ) : true | RESTfulAPI_Error Checks if a request to the API is authenticated
getOwner ( SS_HTTPRequest $request ) : null | DataObject Returns the DataObject related to the authenticated request

Method Details

authenticate() public method

Checks if a request to the API is authenticated
public authenticate ( SS_HTTPRequest $request ) : true | RESTfulAPI_Error
$request SS_HTTPRequest HTTP API request
return true | RESTfulAPI_Error True if token is valid OR RESTfulAPI_Error with details

getOwner() public method

Returns the DataObject related to the authenticated request
public getOwner ( SS_HTTPRequest $request ) : null | DataObject
$request SS_HTTPRequest HTTP API request
return null | DataObject null if failed or the DataObject related to the request