Skip to content

docs(faq): document why new scopes need a redeploy and a fresh token - #710

Open
amrit-agarwal-1 wants to merge 1 commit into
mainfrom
docs/faq-scope-changes
Open

docs(faq): document why new scopes need a redeploy and a fresh token#710
amrit-agarwal-1 wants to merge 1 commit into
mainfrom
docs/faq-scope-changes

Conversation

@amrit-agarwal-1

@amrit-agarwal-1 amrit-agarwal-1 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Adds an FAQ entry for something that keeps catching people out: you grant a scope to the External Application, but calls still fail because the token has the old scopes.

Two reasons it doesn't just work:

  1. The app reads the scopes it asks for from the uipath:scope meta tag, which is written at deploy time. Editing uipath.json does nothing until you redeploy.
  2. The token is cached in sessionStorage and only checked for expiry, not for whether its scopes still match. So an open session keeps the old token.

The entry lists the four steps (grant, uipath.json, redeploy, fresh token) and shows sdk.logout().

It also says a page refresh won't help. I checked this in a browser, sessionStorage survives a reload. Hard reload only skips the HTTP cache so it won't clear it either, though I couldn't test that one directly.

Docs only.

Side note: the scope isn't part of the cache key, so the SDK can't tell the token is stale. Adding it to the key would fix this properly and we could drop the FAQ entry. Can raise separately if you want.

@amrit-agarwal-1
amrit-agarwal-1 requested review from a team and vnaren23 September 3, 2026 07:43
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://UiPath.github.io/uipath-typescript/pr-preview/pr-710/

Built to branch gh-pages at 2026-09-08 20:49 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated
@amrit-agarwal-1
amrit-agarwal-1 force-pushed the docs/faq-scope-changes branch 2 times, most recently from 568bd6d to ef666d3 Compare September 3, 2026 07:55
@claude

claude Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated
Comment thread docs/FAQ.md Outdated
@claude

claude Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

@claude

claude Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

Granting a scope to the External Application is not enough on its own, and what
else is needed depends on how the app declares its scopes.

If uipath.json has no scope field, deploy pulls every scope granted to the
client, so a redeploy is enough. If scope is set in uipath.json, or passed to
UiPath() in code, that value wins and the app has to be changed, rebuilt,
packed, published and deployed.

On top of that the token is cached in sessionStorage and only checked for
format and expiry, never for whether its scopes still match, so an open session
keeps using the old token until the user signs out or closes the tab.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@claude

claude Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

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.

3 participants