Hi, I’ve encountered a problem when

Hi, I’ve encountered a problem when applying runtime filters on object access token. This is my use case: - I need to have a token with runtime filter ONLY for a specific liveboard - The liveboard should also support another filter, for a different column, - The liveboard should be embedded in our app, while applying both the filter on the token and the additional filter what I tried is: - fetch the object access token providing the liveboard id and the following runtime_filter
"user_parameters": {
"runtime_filters": [
{
"column_name": "Organization Id",
"operator": "EQ",
"values": [<id>],
"persist": false
}
]
}
"user_parameters": {
"runtime_filters": [
{
"column_name": "Organization Id",
"operator": "EQ",
"values": [<id>],
"persist": false
}
]
}
- went to the embed playground, replaced the token with my own, and try to embed the liveboard with another runtime filter
runtimeFilters: [{
columnName: 'Module Id', // eg: color
operator: RuntimeFilterOp.EQ,
values: [<id>] // eg: red
}]
runtimeFilters: [{
columnName: 'Module Id', // eg: color
operator: RuntimeFilterOp.EQ,
values: [<id>] // eg: red
}]
- I saw the specific dashboard, while other dashboards were restricted as expected. - However, I’m seeing ALL of the data, instead of the filtered data by the token and the runtime filter I applied Can you spot what is wrong? have I missed something?
17 Replies
shikharTS
shikharTS2mo ago
User parameters has been deprecated since 10.4.0.cl. Which cluster version are you using?
shikharTS
shikharTS2mo ago
No description
TomerLand
TomerLandOP2mo ago
I see, I'm not sure my cluster version. So is there a version of the updated docs? so there's no option to add runtime filters on the token level? I saw that the custom token API should provide that behavior with filters, but it seems like it is not supporting liveboards... is that correct? how can I achieve that on Liveboards?
shikharTS
shikharTS2mo ago
You can do that on worksheet form which the liveboard is made. Giving runtime filters on livebaords has been deprecated due to some issues. you can check your cluster version from the question mark beside your profile picture in TS UI
TomerLand
TomerLandOP2mo ago
Can you please elaborate on how we can do that via worksheet?
shikharTS
shikharTS2mo ago
So with custom token API you can add the filter rules on the worksheet, rather than on liveboards
TomerLand
TomerLandOP2mo ago
I tried to do the following - fetch object access token using the worksheet's id and added a filter for that token - I tried to fetch the liveboard using that token, it failed - the user is part of a group that's containing the Liveboard
shikharTS
shikharTS2mo ago
Sorry my bad. I think your use case to restrict access will be satisfied by the /token/object API. This is how your payload should look like
curl -X POST \
--url 'https://{tsUrl}/api/rest/2.0/auth/token/object' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{
"username": "username4",
"validity_time_in_sec": 300,
"auto_create": false,
"object_id": "liveboard_id",
"user_parameters": {
"runtime_filters": [
{
"column_name": "col",
"values": [
"a"
],
"operator": "EQ",
"persist": false,
"objects": [
{
"type": "LOGICAL_TABLE",
"identifier": "worksheet_id"
}
]
}
]
}
}'
curl -X POST \
--url 'https://{tsUrl}/api/rest/2.0/auth/token/object' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{
"username": "username4",
"validity_time_in_sec": 300,
"auto_create": false,
"object_id": "liveboard_id",
"user_parameters": {
"runtime_filters": [
{
"column_name": "col",
"values": [
"a"
],
"operator": "EQ",
"persist": false,
"objects": [
{
"type": "LOGICAL_TABLE",
"identifier": "worksheet_id"
}
]
}
]
}
}'
Does this payload not satisfy your use case? In this payload, the access is restricted to liveboard_id, the runtime_filters given will be applicable only on worksheet with id as worksheet_id
TomerLand
TomerLandOP2mo ago
I thought you said this API is deprecated, no?
shikharTS
shikharTS2mo ago
Ohh it is deprecated for liveboards and answers to be given in user_parameters
TomerLand
TomerLandOP2mo ago
Ok I think I understand. let me try that for a second.
shikharTS
shikharTS2mo ago
@Sandeep @Anand Pushpraj can you also chime in here if my understanding is correct
TomerLand
TomerLandOP2mo ago
is the token geenrated by this API can be used to fetch the liveboard via the metadata/liveboard/data endpoint? or just for embeding?
shikharTS
shikharTS2mo ago
it can be used to fetch the liveboard as well
TomerLand
TomerLandOP2mo ago
So unfortunatly it is not working for me... I'm not able to fetch the liveboard using the token... what's weird is that I can see the liveboard in the embed playground (with no filters)
shikharTS
shikharTS2mo ago
So looks like I might be wrong. user_parameters is entirely deprecated from what I am confirming internally..
TomerLand
TomerLandOP2mo ago
it actually works for me now. maybe we are on an old cluster... the only issue with you approach is that we have a column X that I want to add runtime filter on, and some answers in the liveboard users tables that lack this X column - this filter out everything from that answer normally we used RLS for that, but we have a special case in this specific liveboard. is there an option to provide an actual column name and not an alias? (for example organization_id is a column that both tables has, but it has a different alias on different tables in the model) btw this is the cluster version 10.6.0.cl-279

Did you find this page helpful?