gluu
公開メンバ関数 | 限定公開変数類 | 静的限定公開変数類 | 非公開変数類 | 全メンバ一覧
Get_authorization_url クラス
Get_authorization_url の継承関係図
Inheritance graph
Get_authorization_url 連携図
Collaboration graph

公開メンバ関数

 __construct ()
 
 getRequestScope ()
 
 setRequestScope ($request_scope)
 
 getRequestPrompt ()
 
 setRequestPrompt ($request_prompt)
 
 getRequestOxdId ()
 
 setRequestOxdId ($request_oxd_id)
 
 getRequestAcrValues ()
 
 setRequestAcrValues ($request_acr_values)
 
 getResponseAuthorizationUrl ()
 
 setCommand ()
 
 setParams ()
 
 oxd_socket_request ($data, $char_count=8192)
 
 request ()
 
 getResponseData ()
 
 getData ()
 
 getCommand ()
 
 getResponseObject ()
 
 getResponseJSON ()
 
 getParams ()
 

限定公開変数類

 $data = array()
 
 $command
 
 $db
 
 $params = array()
 
 $response_json
 
 $response_object
 
 $response_data = array()
 

静的限定公開変数類

static $socket = null
 

非公開変数類

 $request_oxd_id = null
 
 $request_scope = null
 
 $request_prompt = null
 
 $request_acr_values = null
 
 $response_authorization_url
 

詳解

構築子と解体子

◆ __construct()

Get_authorization_url::__construct ( )

Constructor

戻り値
void
94  {
95  parent::__construct(); // TODO: Change the autogenerated stub
96  }

関数詳解

◆ getCommand()

Client_OXD_RP::getCommand ( )
inherited
戻り値
string
164  {
165  return $this->command;
166  }
$command
Definition: Client_OXD_RP.php:62

◆ getData()

Client_OXD_RP::getData ( )
inherited
戻り値
array
155  {
156  $this->data = array('command' => $this->getCommand(), 'params' => $this->getParams());
157  return $this->data;
158  }
$data
Definition: Client_OXD_RP.php:61
getParams()
Definition: Client_OXD_RP.php:199
getCommand()
Definition: Client_OXD_RP.php:163

◆ getParams()

Client_OXD_RP::getParams ( )
inherited
戻り値
array
200  {
201  return $this->params;
202  }
$params
Definition: Client_OXD_RP.php:64

◆ getRequestAcrValues()

Get_authorization_url::getRequestAcrValues ( )
戻り値
array
149  {
151  }
$request_acr_values
Definition: Get_authorization_url.php:79

◆ getRequestOxdId()

Get_authorization_url::getRequestOxdId ( )
戻り値
string
132  {
133  return $this->request_oxd_id;
134  }
$request_oxd_id
Definition: Get_authorization_url.php:67

◆ getRequestPrompt()

Get_authorization_url::getRequestPrompt ( )
戻り値
string
116  {
117  return $this->request_prompt;
118  }
$request_prompt
Definition: Get_authorization_url.php:75

◆ getRequestScope()

Get_authorization_url::getRequestScope ( )
戻り値
null
101  {
102  return $this->request_scope;
103  }
$request_scope
Definition: Get_authorization_url.php:71

◆ getResponseAuthorizationUrl()

Get_authorization_url::getResponseAuthorizationUrl ( )
戻り値
string
166  {
167  $this->response_authorization_url = $this->getResponseData()->authorization_url;
169  }
getResponseData()
Definition: Client_OXD_RP.php:140
$response_authorization_url
Definition: Get_authorization_url.php:86

◆ getResponseData()

Client_OXD_RP::getResponseData ( )
inherited
戻り値
mixed
141  {
142  if (!$this->getResponseObject()) {
143  $this->response_data = 'Data is empty';
144  return;
145  } else {
146  $this->response_data = $this->getResponseObject()->data;
147  }
148  return $this->response_data;
149  }
getResponseObject()
Definition: Client_OXD_RP.php:177
$response_data
Definition: Client_OXD_RP.php:67

◆ getResponseJSON()

Client_OXD_RP::getResponseJSON ( )
inherited

function getting result from oxD server. return: response_json - The JSON response from the oxD Server

187  {
188  return $this->response_json;
189  }
$response_json
Definition: Client_OXD_RP.php:65

◆ getResponseObject()

Client_OXD_RP::getResponseObject ( )
inherited

getResult function geting result from oxD server. Return: response_object - The JSON response parsing to object

178  {
179  return $this->response_object;
180  }
$response_object
Definition: Client_OXD_RP.php:66

◆ oxd_socket_request()

Client_OXD_RP::oxd_socket_request (   $data,
  $char_count = 8192 
)
inherited

request to oxd socket

80  {
81  $db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE, DB_PORT);
82  $oxd_config = json_decode($db->query("SELECT `gluu_value` FROM `" . DB_PREFIX ."gluu_table` WHERE `gluu_action` LIKE 'gluu_config'")->row['gluu_value'],true);
83  self::$socket = stream_socket_client('127.0.0.1:' . $oxd_config['gluu_oxd_port'], $errno, $errstr, STREAM_CLIENT_PERSISTENT);
84  if (!self::$socket) {
85  return 'Can not connect to oxd server';
86  }else{
87  fwrite(self::$socket, $data);
88  $result = fread(self::$socket, $char_count);
89  fclose(self::$socket);
90  return $result;
91  }
92 
93  }
$data
Definition: Client_OXD_RP.php:61
$db
Definition: Client_OXD_RP.php:63

◆ request()

Client_OXD_RP::request ( )
inherited

send function sends the command to the oxD server.

Args: command (dict) - Dict representation of the JSON command string

101  {
102  $this->setParams();
103 
104  $jsondata = json_encode($this->getData(), JSON_UNESCAPED_SLASHES);
105 
106  $lenght = strlen($jsondata);
107  if($lenght<=0){
108  return array('status'=> false, 'message'=> 'Sorry .Problem with oxd.');
109  }else{
110  $lenght = $lenght <= 999 ? "0" . $lenght : $lenght;
111  }
112 
113  $this->response_json = $this->oxd_socket_request(utf8_encode($lenght . $jsondata));
114  if($this->response_json !='Can not connect to oxd server'){
115  $this->response_json = str_replace(substr($this->response_json, 0, 4), "", $this->response_json);
116  if ($this->response_json) {
117  $object = json_decode($this->response_json);
118  if ($object->status == 'error') {
119  if($object->data->error == "invalid_op_host"){
120  return array('status'=> false, 'message'=> $object->data->error);
121  }elseif($object->data->error == "internal_error"){
122  return array('status'=> false, 'message'=> $object->data->error , 'error_message'=>$object->data->error_description);
123  }else{
124  return array('status'=> false, 'message'=> $object->data->error . ' : ' . $object->data->error_description);
125  }
126  } elseif ($object->status == 'ok') {
127  $this->response_object = json_decode($this->response_json);
128  return array('status'=> true);
129  }
130  }
131  }else{
132  return array('status'=> false, 'message'=> 'Can not connect to the oxd server. Please check the oxd-config.json file to make sure you have entered the correct port and the oxd server is operational.');
133  }
134 
135  }
oxd_socket_request($data, $char_count=8192)
Definition: Client_OXD_RP.php:80
getData()
Definition: Client_OXD_RP.php:154

◆ setCommand()

Get_authorization_url::setCommand ( )

Protocol command to oXD server

戻り値
void
175  {
176  $this->command = 'get_authorization_url';
177  }

◆ setParams()

Get_authorization_url::setParams ( )

Protocol parameter to oXD server

戻り値
void
183  {
184  $this->params = array(
185  "oxd_id" => $this->getRequestOxdId(),
186  "acr_values" => $this->getRequestAcrValues(),
187  "prompt" => $this->getRequestPrompt(),
188  "scope" => $this->getRequestScope()
189  );
190  }
getRequestScope()
Definition: Get_authorization_url.php:100
getRequestOxdId()
Definition: Get_authorization_url.php:131
getRequestAcrValues()
Definition: Get_authorization_url.php:148
getRequestPrompt()
Definition: Get_authorization_url.php:115

◆ setRequestAcrValues()

Get_authorization_url::setRequestAcrValues (   $request_acr_values)
引数
array$request_acr_values
戻り値
void
158  {
159  $this->request_acr_values = $request_acr_values;
160  }
$request_acr_values
Definition: Get_authorization_url.php:79

◆ setRequestOxdId()

Get_authorization_url::setRequestOxdId (   $request_oxd_id)
引数
string$request_oxd_id
戻り値
void
141  {
142  $this->request_oxd_id = $request_oxd_id;
143  }
$request_oxd_id
Definition: Get_authorization_url.php:67

◆ setRequestPrompt()

Get_authorization_url::setRequestPrompt (   $request_prompt)
引数
string$request_prompt
124  {
125  $this->request_prompt = $request_prompt;
126  }
$request_prompt
Definition: Get_authorization_url.php:75

◆ setRequestScope()

Get_authorization_url::setRequestScope (   $request_scope)
引数
null$request_scope
109  {
110  $this->request_scope = $request_scope;
111  }
$request_scope
Definition: Get_authorization_url.php:71

メンバ詳解

◆ $command

Client_OXD_RP::$command
protectedinherited

◆ $data

Client_OXD_RP::$data = array()
protectedinherited

◆ $db

Client_OXD_RP::$db
protectedinherited

◆ $params

Client_OXD_RP::$params = array()
protectedinherited

◆ $request_acr_values

Get_authorization_url::$request_acr_values = null
private

◆ $request_oxd_id

Get_authorization_url::$request_oxd_id = null
private

◆ $request_prompt

Get_authorization_url::$request_prompt = null
private

◆ $request_scope

Get_authorization_url::$request_scope = null
private

◆ $response_authorization_url

string Get_authorization_url::$response_authorization_url
private

It is authorization url to gluu server. After getting this parameter go to that url and you can login to gluu server, and get response about your users

◆ $response_data

Client_OXD_RP::$response_data = array()
protectedinherited

◆ $response_json

Client_OXD_RP::$response_json
protectedinherited

◆ $response_object

Client_OXD_RP::$response_object
protectedinherited

◆ $socket

Client_OXD_RP::$socket = null
staticprotectedinherited

このクラス詳解は次のファイルから抽出されました: