From 9c10dee48cb986a27cc749b3f7213baeb493004b Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 24 Dec 2023 10:15:23 +0200 Subject: [PATCH] Add section about using personal access tokens to README The uipathcli supports personal access tokens (PAT) since some time now. Extended the auth documentation to include details on how to use PATs. --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/README.md b/README.md index c37f9d2..24a0aa0 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,8 @@ The CLI supports multiple ways to authorize with the UiPath services: - **OAuth Login**: Login to UiPath using your browser and SSO of choice. This is the preferred flow when you are using the CLI interactively. No need to manage any credentials. +- **Personal Access Token**: Generate a PAT and configure the CLI to use the access token. + ### Client Credentials In order to use client credentials, you need to set up an [External Application (Confidential)](https://docs.uipath.com/automation-cloud/docs/managing-external-applications) and generate an [application secret](https://docs.uipath.com/automation-suite/docs/managing-external-applications#generating-a-new-app-secret): @@ -220,6 +222,40 @@ Successfully configured uipath CLI uipath orchestrator users get ``` +### Personal Access Token + +You need to generate a personal access token (PAT) and configure the CLI to use it: + +1. Go to [https://cloud.uipath.com/\<*your-org*\>/portal_/personalAccessToken](https://cloud.uipath.com) + +2. Click **+ Generate new token** + +3. Fill out the fields: +* **Name**: *\* +* **Expiration Date**: Set an expiry date for the token +* **+ Add Scopes**: Add the permissions you want to grant the PAT + +5. Click **Save** and make sure you copy the generated token. + +4. Run the interactive CLI configuration: + +```bash +uipath config --auth pat +``` + +The CLI will ask you to enter the main config settings like +- `organization` and `tenant` used by UiPath services which are account-scoped or tenant-scoped +- `pat` your personal access token + +``` +Enter organization [not set]: uipatcleitzc +Enter tenant [not set]: DefaultTenant +Enter personal access token [*******26-1]: rt_B637A751... +Successfully configured uipath CLI +``` + +After that the CLI should be ready and you can validate that it is working by invoking one of the services. + ### Configuration File You can also manually create or edit the configuration file `.uipath/config` in your home directory. The following config file sets up the default profile with clientId, clientSecret so that the CLI can generate a bearer token before calling any of the services. It also sets the organization and tenant for services which require it.