Skip to content

feat: add client credentials unattended auth flow #404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cristipufu
Copy link
Member

@cristipufu cristipufu commented Jun 13, 2025

Pull Request Overview

This PR adds a client credentials unattended authentication flow to the CLI tool.

  • Introduces new CLI options (--client-id, --client-secret, --base-url) to facilitate unattended authentication.
  • Implements a new authentication branch in auth() to handle client credentials and falls back to interactive mode when credentials are not provided.
  • Adds a new module (src/uipath/_cli/_auth/_client_credentials.py) that encapsulates the client credentials authentication logic.

Usage Example

The external app needs the OR.Execution Orchestrator scope for package publishing.

uipath auth --client-id='12345678-c4c5-4f1f-93ff-4f5ab47d57ea' --client-secret='xxx' --base-url='https://alpha.uipath.com/account/tenant'

uipath publish --tenant

Ref: #388
Ref: UiPath/uipath-langchain-python#96

Development Package

  • Add this package as a dependency in your pyproject.toml:
[project]
dependencies = [
  # Exact version:
  "uipath==2.0.64.dev1004040439",

  # Any version from PR
  "uipath>=2.0.64.dev1004040000,<2.0.64.dev1004050000"
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath = { index = "testpypi" }

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a client credentials unattended authentication flow to the CLI tool.

  • Introduces new CLI options (--client-id, --client-secret, --scope, --base-url) to facilitate unattended authentication.
  • Implements a new authentication branch in auth() to handle client credentials and falls back to interactive mode when credentials are not provided.
  • Adds a new module (src/uipath/_cli/_auth/_client_credentials.py) that encapsulates the client credentials authentication logic.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/uipath/_cli/cli_auth.py Updated auth() to support client credentials flow with new CLI options.
src/uipath/_cli/_auth/_client_credentials.py New module implementing the client credentials authentication flow.
Comments suppressed due to low confidence (1)

src/uipath/_cli/cli_auth.py:103

  • Consider validating that both client_id and client_secret are provided together. If only one of these is specified, prompt the user with an explicit error message rather than silently falling back to the interactive flow.
if client_id and client_secret:

@cristipufu cristipufu added the build:dev Create a dev build from the pr label Jun 13, 2025
@cristipufu cristipufu force-pushed the feat/client_credentials_auth_flow branch 2 times, most recently from 5701646 to 3c36ebf Compare June 13, 2025 14:31
@cristipufu cristipufu force-pushed the feat/client_credentials_auth_flow branch from 3c36ebf to 13a0d10 Compare June 13, 2025 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build:dev Create a dev build from the pr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants