In order to fix the token generation were re ordered some fragments of code.
This commit is contained in:
@@ -2162,13 +2162,11 @@ class RestContext extends BehatContext
|
|||||||
throw new Exception('Bad credentials');
|
throw new Exception('Bad credentials');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//print "<textarea>$answer</textarea>";
|
//print "<textarea>$answer</textarea>";
|
||||||
if (curl_error($ch)) {
|
if (curl_error($ch)) {
|
||||||
throw new Exception(curl_error($ch));
|
throw new Exception(curl_error($ch));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Read the session saved in the cookie file
|
// Read the session saved in the cookie file
|
||||||
|
|
||||||
if(!file_exists($cookie_file)){
|
if(!file_exists($cookie_file)){
|
||||||
@@ -2202,20 +2200,21 @@ class RestContext extends BehatContext
|
|||||||
}
|
}
|
||||||
$parts = parse_url($newurl);
|
$parts = parse_url($newurl);
|
||||||
|
|
||||||
parse_str($parts['fragment'], $fragment);
|
|
||||||
//print_r($fragment);
|
|
||||||
// json_decode(json)
|
|
||||||
$response=json_decode($answer);
|
|
||||||
|
|
||||||
if (file_exists("session.data")) {
|
if (file_exists("session.data")) {
|
||||||
$sessionData = json_decode(file_get_contents("session.data"));
|
$sessionData = json_decode(file_get_contents("session.data"));
|
||||||
} else {
|
} else {
|
||||||
$sessionData = new StdClass();
|
$sessionData = new StdClass();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//print_r($fragment);
|
||||||
|
// json_decode(json)
|
||||||
|
//$response=json_decode($answer);
|
||||||
|
parse_str($parts['fragment'], $fragment);
|
||||||
foreach($fragment as $key => $varValue){
|
foreach($fragment as $key => $varValue){
|
||||||
$sessionVarName=$key."_".$implicit_grant_number;
|
$sessionVarName=$key."_".$implicit_grant_number;
|
||||||
$sessionData->$sessionVarName = $varValue;
|
$sessionData->$sessionVarName = $varValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//print_r($sessionData);
|
//print_r($sessionData);
|
||||||
file_put_contents("session.data", json_encode($sessionData));
|
file_put_contents("session.data", json_encode($sessionData));
|
||||||
//print_r("\nRegister application:\n".$answer."\n$oauth_authorization_url?response_type=$response_type&client_id=$client_id&scope=$scope\n");
|
//print_r("\nRegister application:\n".$answer."\n$oauth_authorization_url?response_type=$response_type&client_id=$client_id&scope=$scope\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user