# Authentication

QV2QS authenticates to Qlik Cloud through qlik-cli contexts. A context is a named authentication configuration that stores a Qlik Cloud tenant URL and an API key. QV2QS ships with qlik-cli bundled into the executable. QV2QS stores contexts in its own isolated location (`%LOCALAPPDATA%\QV2QS\qlik-cli\.qlik\contexts.yml`), separate from the default qlik-cli configuration. An existing qlik-cli installation is not affected.

## Authentication methods

Authentication can be set up in three ways:

* Interactive setup — Run `QV2QS.exe --setupQlikAuth`. QV2QS lists any existing contexts, prompts for a context name (or selection), then prompts for a tenant URL and API key. The API key input is hidden for security. QV2QS creates or updates the context and validates the connection.
* CLI arguments — Pass `--qlikTenantUrl` and `--qlikApiKey` on the command line. QV2QS authenticates inline without creating or modifying a context file. Credentials are injected directly into each API call and are not written to disk. This is the simplest method for CI/CD pipelines and one-off conversions. Alternatively, pass `--qlikApiKey` alone to update the key in the active qlik-cli context.
* User interface — Enter the tenant URL and API key on the Qlik Cloud auth step. The wizard validates the connection before proceeding.

Authentication arguments include `--qlikContext`, `--qlikTenantUrl`, `--qlikApiKey`, and `--setupQlikAuth`. For the full list, see [Argument reference](https://help.qlik.com/en-US/migration/Content/Qv2qsMigration/command-line-interface/argument-reference.htm).

## Updating an expired API key

Qlik Cloud API keys expire after the period configured by the tenant administrator. To replace an expired key, do one of the following:

* Re-run `QV2QS.exe --setupQlikAuth` and enter the new API key when prompted.
* Pass `--qlikApiKey <NEW_KEY>` on any conversion command (without `--qlikTenantUrl`). QV2QS updates the stored context automatically. If both `--qlikTenantUrl` and `--qlikApiKey` are provided, inline authentication is used and no context is updated.
* Set the `QV2QS_QLIK_API_KEY` environment variable to the new key.

## Learn more

* [Setting up Qlik Cloud access](https://help.qlik.com/en-US/migration/Content/Qv2qsMigration/getting-started/setting-up-qlik-cloud-access.htm)
* [Deploying to Qlik Cloud](https://help.qlik.com/en-US/migration/Content/Qv2qsMigration/deploying-to-qlik-cloud/index.htm)