feat: add client credentials unattended auth flow#404
Merged
cristipufu merged 1 commit intomainfrom Jul 1, 2025
Merged
Conversation
razvalex
approved these changes
Jun 13, 2025
3c36ebf to
13a0d10
Compare
gheorghitahurmuz
approved these changes
Jun 23, 2025
gheorghitahurmuz
approved these changes
Jun 23, 2025
151ed0b to
f710149
Compare
f710149 to
ef9e00d
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR introduces an unattended client credentials authentication flow to the CLI, allowing non-interactive login using a client ID, client secret, and base URL.
- Adds
--client-id,--client-secret, and--base-urlCLI options and branchesauth()to handle client credentials. - Implements
ClientCredentialsServiceto acquire tokens and update environment variables. - Falls back to existing interactive flow when credentials aren’t provided.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/uipath/_cli/cli_auth.py | Adds new options and branching logic for client creds. |
| src/uipath/_cli/_auth/_client_credentials.py | New service module for implementing client creds flow. |
Comments suppressed due to low confidence (2)
src/uipath/_cli/_auth/_client_credentials.py:71
- The new client credentials authentication flow isn’t covered by existing tests. Add unit tests for
authenticate()(including success, 400, 401, and network failure scenarios) to ensure reliability.
def authenticate(
src/uipath/_cli/cli_auth.py:101
- The name
consoleis not imported in this file, which will cause a NameError. Please import the appropriate console/logger instance (e.g.from ._utils._console import console).
)
Comment on lines
+109
to
+113
| if base_url: | ||
| extracted_domain = credentials_service.extract_domain_from_base_url( | ||
| base_url | ||
| ) | ||
| credentials_service.domain = extracted_domain |
There was a problem hiding this comment.
[nitpick] This inner if base_url: check is redundant because base_url was already validated above. You can remove this condition to simplify the logic.
Suggested change
| if base_url: | |
| extracted_domain = credentials_service.extract_domain_from_base_url( | |
| base_url | |
| ) | |
| credentials_service.domain = extracted_domain | |
| extracted_domain = credentials_service.extract_domain_from_base_url( | |
| base_url | |
| ) | |
| credentials_service.domain = extracted_domain |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Overview
This PR adds a client credentials unattended authentication flow to the CLI tool.
Usage Example
The external app needs the
OR.ExecutionOrchestrator scope for package publishing.Ref: #388
Ref: UiPath/uipath-langchain-python#96
Development Package