Skip to content

Add support for refresh tokens#195

Merged
thschmitt merged 1 commit intomainfrom
feature/refresh-token-support
May 22, 2025
Merged

Add support for refresh tokens#195
thschmitt merged 1 commit intomainfrom
feature/refresh-token-support

Conversation

@thschmitt
Copy link
Copy Markdown
Collaborator

The CLI makes the user go through the oauth login authorization flow every time the access token expired. The access tokens are short-lived and expiration is currently set to 1 hour which requires the user to re-login almost every time they are using the CLI.

Taking advantage of the refresh token support in the Identity Server to automatically renew access tokens for the user. If there is a valid refresh token, there is no action required by the user.

In case the refresh token expired or the renewal of the access token fails for any other reason, the user is required to login again.

Implementation:

  • Automatically adding the offline_access scope during the oauth flow so that the Identity Server returns a refresh token.

  • Caching the refresh token using the cache package similar to access tokens.

  • Added new configuration parameter offlineAccess to disable refresh token support, e.g.

- name: default
  organization: <your-org>
  tenant: defaulttenant
  auth:
    offlineAccess: false
  • Extended debug logging to log identity server requests and responses as well as detailed log messages for refresh token and access token handling. Redacting the client secret and refresh tokens to avoid them being accidentally leaked

Implements #193

The CLI makes the user go through the oauth login authorization flow every
time the access token expired. The access tokens are short-lived and
expiration is currently set to 1 hour which requires the user to
re-login almost every time they are using the CLI.

Taking advantage of the refresh token support in the Identity Server to
automatically renew access tokens for the user. If there is a valid
refresh token, there is no action required by the user.

In case the refresh token expired or the renewal of the access token
fails for any other reason, the user is required to login again.

Implementation:

- Automatically adding the offline_access scope during the oauth flow so
  that the Identity Server returns a refresh token.

- Caching the refresh token using the cache package similar to access
  tokens.

- Added new configuration parameter `offlineAccess` to disable refresh
  token support, e.g.

```
- name: default
  organization: <your-org>
  tenant: defaulttenant
  auth:
    offlineAccess: false
```

- Extended debug logging to log identity server requests and responses
  as well as detailed log messages for refresh token and access token
  handling. Redacting the client secret and refresh tokens to avoid them
  being accidentally leaked

Implements #193
@thschmitt thschmitt merged commit 9bd99ed into main May 22, 2025
10 checks passed
@thschmitt thschmitt linked an issue May 22, 2025 that may be closed by this pull request
@thschmitt thschmitt deleted the feature/refresh-token-support branch May 22, 2025 09:55
vorflux bot pushed a commit to sankeerthrao/uipathcli that referenced this pull request Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refresh token support

2 participants