wkstar / oauth2-demo-php

A demo application for running an OAuth2 server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

oAuth System

Login

asdfasdfasd

asdfasdf

oAuth Login

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

asdasd oAuth Authorise asdasd

oAuth Login

    $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.

About

A demo application for running an OAuth2 server


Languages

Language:PHP 36.8%Language:CSS 35.3%Language:HTML 27.6%Language:ApacheConf 0.3%