Public Member Functions

ApiAuthInterface Interface Reference

Describe the methods that every API Auth Component should comply with API auth should be a token based authentication that uses 'access_token' and 'refresh_token'. More...

Inheritance diagram for ApiAuthInterface:
ApiAuthComponent

List of all members.

Public Member Functions

 identify ()
 Identify and return an user starting from an access_token Return false if it's not possible to identify a user.
 authenticate ($username, $password, array $authGroupName=array())
 Authenticate a user based on username and password.
 generateToken ()
 Generate and return a new access_token If user is not identified/authenticated it returns null.
 renewToken ($refreshToken)
 Renew an access_token using a refresh token If it fails then return false.
 generateRefreshToken ()
 Generate a refresh token to use for renew an access_token The refresh token should be saved in hash_jobs table If user is not identified/authenticated then return false.
 revokeRefreshToken ($refreshToken)
 Revoke a refresh token If user is not identified/authenticated then return false.
 getToken ()
 Return the access_token reading from Authorization header or from query url Return false if no token is found.
 expiresIn ()
 Return the updated time to access_token expiration (in seconds).
 userid ()
 Return the userid It replaces BeAuthComponent::userid() in API context.
 getUserSession ()
 Return the user data it replaces BeAuthComponent::getUserSession() in API context.
 getUser ()
 Get the current identified/authenticated user It replaces BeAuthComponent::getUser() in API context.

Detailed Description

Describe the methods that every API Auth Component should comply with API auth should be a token based authentication that uses 'access_token' and 'refresh_token'.

Definition at line 26 of file api_auth_interface.php.


Member Function Documentation

ApiAuthInterface::authenticate ( username,
password,
array $  authGroupName = array() 
)

Authenticate a user based on username and password.

Parameters:
string $username the username
string $password the user password
array $authGroupName an array of groups authorized to access API
Returns:
bool

Implemented in ApiAuthComponent.

ApiAuthInterface::expiresIn (  ) 

Return the updated time to access_token expiration (in seconds).

Returns:
int

Implemented in ApiAuthComponent.

ApiAuthInterface::generateRefreshToken (  ) 

Generate a refresh token to use for renew an access_token The refresh token should be saved in hash_jobs table If user is not identified/authenticated then return false.

Returns:
string|bool

Implemented in ApiAuthComponent.

ApiAuthInterface::generateToken (  ) 

Generate and return a new access_token If user is not identified/authenticated it returns null.

Returns:
string|null

Implemented in ApiAuthComponent.

ApiAuthInterface::getToken (  ) 

Return the access_token reading from Authorization header or from query url Return false if no token is found.

Returns:
string|bool

Implemented in ApiAuthComponent.

ApiAuthInterface::getUser (  ) 

Get the current identified/authenticated user It replaces BeAuthComponent::getUser() in API context.

Returns:
array

Implemented in ApiAuthComponent.

ApiAuthInterface::getUserSession (  ) 

Return the user data it replaces BeAuthComponent::getUserSession() in API context.

Returns:
array

Implemented in ApiAuthComponent.

ApiAuthInterface::identify (  ) 

Identify and return an user starting from an access_token Return false if it's not possible to identify a user.

Returns:
array|bool Either array of user information or false

Implemented in ApiAuthComponent.

ApiAuthInterface::renewToken ( refreshToken  ) 

Renew an access_token using a refresh token If it fails then return false.

Parameters:
string $refreshToken the refresh token
Returns:
string|bool

Implemented in ApiAuthComponent.

ApiAuthInterface::revokeRefreshToken ( refreshToken  ) 

Revoke a refresh token If user is not identified/authenticated then return false.

Parameters:
string $refreshToken the refresh token to remove
Returns:
bool

Implemented in ApiAuthComponent.

ApiAuthInterface::userid (  ) 

Return the userid It replaces BeAuthComponent::userid() in API context.

Returns:
string

Implemented in ApiAuthComponent.


The documentation for this interface was generated from the following file:
Generated on Fri Dec 11 2015 15:29:45 by Doxygen 1.7.1  BEditaBEdita 3.7 Corylus