我使用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)
);
来自没有PHP背景的人的一些注意事项:
qps/app/full
而不是qrs/app/full
qrs/app/full?Xrfkey=01234567890123456
X-Qlik-User: UserDirectory=<directory>; UserId=<userid>
参考文献: