* Adapted from Oauth2-server-php cookbook * @see http://bshaffer.github.io/oauth2-server-php-docs/cookbook/ */ // include our OAuth2 Server object require_once __DIR__.'/server.php'; $request = OAuth2\Request::createFromGlobals(); $response = new OAuth2\Response(); // validate the authorize request if (!$server->validateAuthorizeRequest($request, $response)) { $response->send(); die; } // if user is not yet authenticated, he is redirected. if (!isset($_SESSION['uid'])) { //store the authorize request $explode_url=explode("/", strip_tags(trim($_SERVER['REQUEST_URI']))); $_SESSION['auth_page']=end($explode_url); header('Location: index.php'); exit(); } // display an authorization form if (empty($_POST)) { exit('
Full Name For the user ' . $_SESSION['uid'] . ' |