Upgraded OFAA OAID scripts for ofaa API v2
This commit is contained in:
@@ -6,7 +6,7 @@ $batch_size = 0;
|
|||||||
|
|
||||||
$oauth_url = "https://sso.yio.at/auth/realms/oaid/protocol/openid-connect/token";
|
$oauth_url = "https://sso.yio.at/auth/realms/oaid/protocol/openid-connect/token";
|
||||||
|
|
||||||
$baseurl = "https://api.oaid.at/v1";
|
$baseurl = "https://api.oaid.at/v2";
|
||||||
$client_id = "oaid.ofaa.esteiermark";
|
$client_id = "oaid.ofaa.esteiermark";
|
||||||
$client_secret = "4a5b09ed-956c-4721-bb53-3a144fc5f55a";
|
$client_secret = "4a5b09ed-956c-4721-bb53-3a144fc5f55a";
|
||||||
$tenant = "ofaa.esteiermark";
|
$tenant = "ofaa.esteiermark";
|
||||||
@@ -21,7 +21,8 @@ $ep_list_oaids = $baseurl."/pip/codes/";
|
|||||||
$ep_request_oaid = $baseurl."/pip/codes/";
|
$ep_request_oaid = $baseurl."/pip/codes/";
|
||||||
$ep_confirm_oaid = $baseurl."/pip/codes/{oaid}/token/";
|
$ep_confirm_oaid = $baseurl."/pip/codes/{oaid}/token/";
|
||||||
|
|
||||||
$default_scope = ["oaid:mgm:read","oaid:codes:read","oaid:codes:write"];
|
//$default_scope = ["oaid:mgm:read","oaid:codes:read","oaid:codes:write"];
|
||||||
|
$default_scope = ["read","write"]; // since v2
|
||||||
$access_token = "";
|
$access_token = "";
|
||||||
|
|
||||||
$token_file = __DIR__."/.access_token";
|
$token_file = __DIR__."/.access_token";
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ function getRestUrl($url, $headers, $params = [], $debug = false) {
|
|||||||
|
|
||||||
if($debug) {
|
if($debug) {
|
||||||
var_dump($_url, $ctx_options);
|
var_dump($_url, $ctx_options);
|
||||||
exit;
|
//exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ctx = stream_context_create($ctx_options);
|
$ctx = stream_context_create($ctx_options);
|
||||||
@@ -59,7 +59,7 @@ function getRestUrl($url, $headers, $params = [], $debug = false) {
|
|||||||
} elseif($response_code == "401") {
|
} elseif($response_code == "401") {
|
||||||
return "__err__401";
|
return "__err__401";
|
||||||
} else {
|
} else {
|
||||||
die("getRestUrl(): $h_line");
|
die("getRestUrl():\n$h_line\n$output");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user