コード例 #1
0
ファイル: RelyingParty.php プロジェクト: J0s3f/simpleid
 public function __construct($realm)
 {
     parent::__construct(array('openid' => array('realm' => $realm, 'services' => NULL, 'discovery_time' => 0)));
     $this->cid = $realm;
     $this->store_id = self::buildID($realm);
 }
コード例 #2
0
ファイル: OAuthClient.php プロジェクト: markwu/simpleid
 public function __construct($data)
 {
     parent::__construct(array_replace_recursive(array('oauth' => array('token_endpoint_auth_method' => 'client_secret_basic', 'response_types' => array('code'), 'grant_types' => array('authorization_code'), 'application_type' => 'web')), $data));
 }
コード例 #3
0
ファイル: DefaultStoreModule.php プロジェクト: J0s3f/simpleid
 /**
  * Loads client data for a specified client name.
  *
  * The client name must exist.  You should check whether the client name exists with
  * the {@link hasClient()} function
  *
  * @param string $client the name of the client to load
  * @return User data for the specified user
  */
 protected function readClient($cid)
 {
     if (!$this->isValidName($cid) || !$this->hasClient($cid)) {
         return null;
     }
     $store_file = $this->config['store_dir'] . "/{$cid}.client";
     if (file_exists($store_file)) {
         $client = $this->f3->mutex($store_file, function ($f3, $store_file) {
             return $f3->unserialize(file_get_contents($store_file));
         }, array($this->f3, $store_file));
     } else {
         $client = new Client();
     }
     $client_file = $this->config['identities_dir'] . "/{$cid}.client.yml";
     if (file_exists($client_file)) {
         try {
             $data = Spyc::YAMLLoad($client_file);
         } catch (Exception $e) {
             $this->f3->get('logger')->log(\Psr\Log\LogLevel::ERROR, 'Cannot read client file ' . $client_file . ' :' . $e->getMessage());
             trigger_error('Cannot read client file ' . $client_file . ' :' . $e->getMessage(), E_USER_ERROR);
         }
         if ($data != null) {
             $client->loadData($data);
         }
     }
     $client->cid = $cid;
     return $client;
 }