Exemplo n.º 1
0
 public function __construct()
 {
     // Initiate the request handler which deals with $_GET, $_POST, etc
     //$this->authserver->getRequest() = new League\OAuth2\Server\Util\Request($_GET);
     // Initiate a new database connection
     //$db = new League\OAuth2\Server\Storage\PDO\Db('mysql://*****:*****@localhost/govid');
     // Create the auth server, the three parameters passed are references
     //  to the storage models
     $this->authserver = new League\OAuth2\Server\Authorization(new Client(), new OauthSession(), new Scope());
     // Enable the authorization code grant type
     $this->authserver->addGrantType(new League\OAuth2\Server\Grant\AuthCode());
     $this->authserver->setRequest(new League\OAuth2\Server\Util\Request($_GET, $_POST, array(), array(), array('HTTP_AUTHORIZATION' => $_ENV['HTTP_AUTHORIZATION']), array('Authorization' => $_ENV['HTTP_AUTHORIZATION'])));
     //$this->authserver->setScopeDelimeter($scopeDelimeter = ',');
     $this->authserver->requireStateParam();
     $this->authserver->requireNonceParam();
     $this->authserver->setDefaultScope('openid');
 }