Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
DanielCordon
Contributor II
Contributor II

Exporting app with data using OAuth in Qlik-CLI

Hi everyone!

I'm creating a script for export, import and publishing apps betweens tenants in Qlik Cloud using Qlik-CLI. As the first step I create a context using following line:

qlik context create test --server https://<TENANT NAME>.us.qlikcloud.com/ --api-key <API KEY>

After that I log into that context with qlik context use test . After that I use following line for export app from a shared space from test tenant

qlik app export <AppId> > <Pathfile>/AppName.qvf 

It does export app with data

Furthermore we should use OAuth client for multitenant managing. So we create context using --oauth-client-id and --oauth-client-secret flags for creating context. 

However, using the last context with this authentication it's exporting app with No Data.

What could be the issue?

Note: I followed this tutorial for creating OAuth client credentials 
https://qlik.dev/manage/platform-operations/authenticate-platform-ops/#how-to-create-a-region-level-...

Thanks in advance.

Labels (2)
1 Solution

Accepted Solutions
DanielCordon
Contributor II
Contributor II
Author

For solving this, I modified the line to set export function with API KEY value, and export with OAuth user credentials.

Best regards!

View solution in original post

4 Replies
Frank_S
Support
Support

Hello @DanielCordon 

I tested with a context which uses an API key only.

I was not able to reproduce the issue. You can actually see the difference when exporting with and without the --NoData flag.

 

Try this below to see if the output size changes for you with and without the --NoData flag.

 

NoData flag: App size is 768KB

No data is seen when opening the app.

 

Without NoData flag: App size is 960kb 

Data is seen when opening the app.

 

If you are consistently reproducing the issue with your specific context configuration however, please do start a support case.

 

Kind regards....

 

 

 

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
DanielCordon
Contributor II
Contributor II
Author

Hi @Frank_S 

I tested that already. Red box is with personal APIKEY and blue one is for OAuth client information

DanielCordon_0-1727475301962.png

 

DanielCordon
Contributor II
Contributor II
Author

For solving this, I modified the line to set export function with API KEY value, and export with OAuth user credentials.

Best regards!

PythonMCSJ
Partner - Contributor III
Partner - Contributor III

Hi DanielCordon,

Your OAuth Client user is lacking the correct roles/permissions in the space of the app, which you are trying to export with data.

When you create a OAuth Client, a corresponding Qlik service user (representing the OAuth client) is created in the Qlik Cloud tenant (IDP: qlikbot), with a name matching the client.

Despite having set different scopes on the OAuth Client, the normal permission based limitations are still applied to the OAuth user - where the default assumption may be that the service user "can do everything" in the tenant. So space permissions still need to be applied, to ensure that the retrieved token of the OAuth Client match what is expected permission wise.

Hope this makes sense.

Kind regards,

PythonMCSJ