oAuth System
Login
asdfasdfasd
asdfasdf
To check login details, use the oAuth class, login function:
$user_name = $_REQUEST['user_name'];
$user_pwd = $_REQUEST['user_pwd'];
...
$oAuth = $this->oAuth->login($user_name, $user_pwd);
//Any sort of error with authentication.
if( isset($oAuth['error']) ||
!isset($oAuth['access_token'])) {
//Deal with errors
...
}
//Return access token to client (mobile app).
$oAuthAccessToken = $oAuth['access_token'];
sdfsdf sdfsdf
sdf
Authorise
$this->username = $this->oAuth->checkScope();
Tasks
- Install oAuth server.
- Ensure database structure is created from sql scripts.
- Write tests for all Controllers.
- Remove references to old token in all PHP.
- Remove sys_user.token in mySql.
- Add a call to the checkScope function for every Controller that needs the user to be logged in.
- Define the Authority required for each Controller.
- Make sure the logic in the oAuth server defining each user's Authority is correct.