add grant_type password for oauth2Client, handle trusted client such as Phraseanet Navigator

This commit is contained in:
Nicolas Le Goff
2012-04-26 14:41:10 +02:00
parent d07661d80f
commit 90b3870901
9 changed files with 2954 additions and 2965 deletions

View File

@@ -245,7 +245,7 @@ class API_OAuth2_Adapter extends OAuth2
, 'usr_id' => $token->get_account()->get_user()->get_id()
, 'oauth_token' => $token->get_value()
);
} catch (Exception $e) {
}

View File

@@ -147,8 +147,8 @@ class API_OAuth2_Application
$stmt->execute(array(':application_id' => $this->id));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->closeCursor();
$this->creator = User_Adapter::getInstance($row['creator'], $this->appbox);
$this->creator = !$row['creator'] ? null :
User_Adapter::getInstance($row['creator'], $this->appbox);
$this->type = $row['type'];
$this->name = $row['name'];
$this->description = $row['description'];

View File

@@ -0,0 +1,24 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class API_OAuth2_Application_Navigator
{
const CLIENT_ID = '\alchemy\phraseanet\id\4f981093aebb66.06844599';
const CLIENT_SECRET = '\alchemy\phraseanet\secret\4f9810d4b09799.51622662';
const CLIENT_NAME = 'phraseanet-navigator';
}