@uipath/auth
Authentication module for the UiPath CLI. Handles OIDC login, token management, and credential storage.
Installation
npm install @uipath/auth
Usage
Interactive Login
import { interactiveLogin } from "@uipath/auth";
await interactiveLogin({ file: ".uipath" });
Client Credentials (CI/CD)
import { clientCredentialsLogin } from "@uipath/auth";
const tokens = await clientCredentialsLogin({
clientId: process.env.CLIENT_ID,
clientSecret: process.env.CLIENT_SECRET,
});
Check Login Status
import { getLoginStatusAsync } from "@uipath/auth";
const status = await getLoginStatusAsync({ file: ".uipath" });
API
interactiveLogin(options) | Browser-based authorization code flow with PKCE |
clientCredentialsLogin(props) | Silent client credentials flow for service accounts |
getLoginStatusAsync(options) | Check current login status, auto-refreshes expired tokens |
refreshAccessToken() | Refresh an expired access token |
selectTenant() | Interactive tenant selection |
setAuthFileConfig(cfg) | Push the on-disk auth.* config slice into the auth singleton (called once by the CLI host at startup) |
saveEnvFileAsync() / loadEnvFileAsync() | Credential file I/O |
License
See the root repository for license information.