我正在使用带有标题身份验证的Qlik Sense,但是由于某些原因,当我向qrs / apps / full运行请求时,Xrftoken = lskadjfalkjd我只能得到公共应用程序。 如何设置用户属性以检索该用户的所有应用程序?
以下是我在php中植入qlik请求:
private static function getRequestHeaders($email)
{
$user = AuthClass::getUser();
$id = $user['UserId'];
$dir = $user['UserDirectory'];
$atts = $user['Attributes'];
$securityHeaders = 'SecureRequest=true; Context=AppAccess;';
foreach ($atts as $attr)
{
$key = key($attr);
$val = $attr[$key];
$securityHeaders .= "{$key}={$val}; ";
}
return [
'headers' =>
[
'X-Qlik-xrfkey: ' . self::$xrfToken,
'hdr-usr: Users\\' . $email,
'Accept: application/json',
'Content-Type: application/json',
"X-Qlik-Security: $securityHeaders",
"X-Qlik-User: UserDirectory={$dir};UserId={$id}",
]
];
}
$res = CurlHelper::get(
'server/qps/app/full?Xrftoken=039498543',
self::getRequestHeaders($email)
);
答案 0 :(得分:1)
一些没有PHP背景的人的笔记:
qps/app/full
而不是qrs/app/full
qrs/app/full?Xrfkey=01234567890123456
X-Qlik-User: UserDirectory=<directory>; UserId=<userid>
参考文献: