Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
senerustunerciyas
Partner - Contributor III
Partner - Contributor III

Qlik-CLI API-Keys Problem

Hello team. I want to enter API-keys to Authenticate to Qlik using qlik-cli contexts. But no matter what key I press on the keyboard or try the copy paste method, nothing changes. I tried from both powershell and cmd but it didn't work. My role in Qlik cloud is developer.

 

Ekran Görüntüsü (72).jpg

Labels (3)
8 Replies
hakana
Employee
Employee

The posted API won't show up in the console since it's treated as a password

And the error you are seeing now indicates that you already have a context configured for that tenant/host
Try running qlik context ls to list the different contexts and you can remove the context by running qlik context rm <name>

shashank_wadje
Employee
Employee

Hi,

As the error says, context already exists, so to add new api key to same context you can use context update command like below 
`qlik context update <context-name> --api-key "<api-key>"`

Or you can delete existing context and add new one
`qlik context rm <context-name>`

`qlik context init`

 

For more help on above context command try running 
`qlik context update -h`
`qlik context init -h`

senerustunerciyas
Partner - Contributor III
Partner - Contributor III
Author

Why am I getting this error? Error: 401 Authorization Required

Ekran Görüntüsü (73).jpg

shashank_wadje
Employee
Employee

The existing api-key is expired or invalid. Try creating new api-key and update existing context with new api-key using context update command


qlik context update <context-name> --api-key "<api-key>"

senerustunerciyas
Partner - Contributor III
Partner - Contributor III
Author

Thank you for all your support. I want to ask one last thing. It requires qlik windows context to install migration tools. I couldn't find where to learn this:

" $QlikWindowsContext "

Ekran Görüntüsü (73).png

DaveChannon
Employee
Employee

Hi @senerustunerciyas 

You need to follow the steps described on the migration centre. You first have to set up a context for windows using the steps documented there, which show you how to create a JWT IdP on client managed, and then generate a JWT, which you can then use to create a new context for Windows.

senerustunerciyas
Partner - Contributor III
Partner - Contributor III
Author

In fact, I have completed almost every process. I created JWT token after setting up virtual proxies. But when I come to the JWT format for Qlik Sense authorization part, I get confused and I don't know how or what I should do. Maybe the payload parts are unnecessary, I don't understand:
The payload.
The signing options.
The private key for signing the token.

Do I need to do these? Do I not create a context when I do the previous operations?

DaveChannon
Employee
Employee

Hey @senerustunerciyas 

Unfortunately you do need to go through each step to generate the JWT. I do agree this process isn't as simple as it could be.

Generating the certificate is the first step. Then:

  • You can use the default signing options specified in the example, unless your organization requires a higher standard (this is unusual)
  • The payload is the piece that's specific to how you have QSECM set up. Which pieces are you having issues with?
  • The private key comes from the certificate you generated in step 1. It should have been composed of a public and private key pair.

The JWT generated through the combination of these items is then what you use to create the new context.