Skip to content

fix(cli): Use device code flow for missing scope re-authentication#15074

Merged
anatrajkovska merged 3 commits intomainfrom
ana/iam-5826-update-cli-to-handle-missing-scope-in-device-code-flow
Feb 24, 2026
Merged

fix(cli): Use device code flow for missing scope re-authentication#15074
anatrajkovska merged 3 commits intomainfrom
ana/iam-5826-update-cli-to-handle-missing-scope-in-device-code-flow

Conversation

@anatrajkovska
Copy link
Copy Markdown
Member

@anatrajkovska anatrajkovska commented Feb 17, 2026

If the user switches to a team using vercel switch which has SSO or MFA enforced and the user hasn't yet authorized the team, instead of redirecting them to the old SSO flow which is deprecated, now we will use the device code flow which supports passing the team_id query param that enforces the user to authorize the request before they can login.

Warning

High Risk Change

This PR changes the authentication flow for team re-authentication, replacing the deprecated SAML/SSO login flow with device code flow, which is a refactor of the auth mechanism that requires careful review to ensure the new flow properly enforces authorization.

  • Replaces SAML login and prompt-based re-auth with device code flow
  • Removes user confirmation prompt before SAML login
  • Always passes teamId for re-authentication (previously conditional on SAML)

Risk assessment for commit 794b171.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 17, 2026

🦋 Changeset detected

Latest commit: 4a3f5b3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
vercel Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 17, 2026

📦 CLI Tarball Ready

The Vercel CLI tarball for this PR is now available!

Quick Test

You can test this PR's CLI directly by running:

npx https://zero-config-hirdhvusb-uncurated-tests.vercel.app/tarballs/vercel.tgz --help

Use in vercel.json

To use this CLI version in your project builds, add to your vercel.json:

{
  "build": {
    "env": {
      "VERCEL_CLI_VERSION": "vercel@https://zero-config-hirdhvusb-uncurated-tests.vercel.app/tarballs/vercel.tgz"
    }
  }
}

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 17, 2026

🧪 Unit Test Strategy

Comparing: fe0c3804a3f5b3 (view diff)

Strategy: Affected packages only

✅ Only testing packages that have been modified or depend on modified packages.

Affected packages - 1 (3%)
  1. vercel
Unaffected packages - 39 (98%)
  1. @vercel-internals/get-package-json
  2. @vercel/backends
  3. @vercel/build-utils
  4. @vercel/cervel
  5. @vercel/cli-auth
  6. @vercel/client
  7. @vercel/config
  8. @vercel/detect-agent
  9. @vercel/edge
  10. @vercel/elysia
  11. @vercel/error-utils
  12. @vercel/express
  13. @vercel/fastify
  14. @vercel/firewall
  15. @vercel/frameworks
  16. @vercel/fs-detectors
  17. @vercel/functions
  18. @vercel/gatsby-plugin-vercel-builder
  19. @vercel/go
  20. @vercel/h3
  21. @vercel/hono
  22. @vercel/hydrogen
  23. @vercel/koa
  24. @vercel/nestjs
  25. @vercel/next
  26. @vercel/node
  27. @vercel/oidc
  28. @vercel/oidc-aws-credentials-provider
  29. @vercel/python
  30. @vercel/python-analysis
  31. @vercel/redwood
  32. @vercel/related-projects
  33. @vercel/remix-builder
  34. @vercel/routing-utils
  35. @vercel/ruby
  36. @vercel/rust
  37. @vercel/static-build
  38. @vercel/static-config
  39. examples

Results

  • Unit tests: Only affected packages will run unit tests
  • E2E tests: Running in parallel via E2E Tests workflow
  • Type checks: Only affected packages will run type checks

This comment is automatically generated based on the affected testing strategy

@anatrajkovska anatrajkovska marked this pull request as ready for review February 18, 2026 13:12
@anatrajkovska anatrajkovska requested review from a team as code owners February 18, 2026 13:12
@anatrajkovska anatrajkovska requested a review from a team February 18, 2026 13:13
Copy link
Copy Markdown
Contributor

@mehulkar mehulkar left a comment

Choose a reason for hiding this comment

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

stamping to get past code owners since Accounts team has already approved

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Feb 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
zero-config-go Ready Ready Preview, Comment Feb 23, 2026 3:32pm

@anatrajkovska anatrajkovska enabled auto-merge (squash) February 24, 2026 10:18
@anatrajkovska anatrajkovska merged commit c347fe1 into main Feb 24, 2026
180 checks passed
@anatrajkovska anatrajkovska deleted the ana/iam-5826-update-cli-to-handle-missing-scope-in-device-code-flow branch February 24, 2026 11:23
styfle pushed a commit that referenced this pull request Feb 24, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## vercel@50.23.0

### Minor Changes

- [dev] allow to skip authentication and project linking for `vc dev` by
setting `VERCEL_EXPERIMENTAL_DEV_SKIP_LINK` env var.
([#15122](#15122))

- [services] detect project root to prevent accidental setup of a
service as a standalone project.
([#15187](#15187))

### Patch Changes

- Fix re-authentication for teams with missing scope to use the device
code flow instead of the deprecated SSO redirect flow.
([#15074](#15074))

- Add CLI eval for vc env command
([#15118](#15118))

-   Updated dependencies \[]:
    -   @vercel/node@5.6.7

## @vercel/functions@3.4.3

### Patch Changes

- [functions] Revert "[functions] URL encode cache tags"
([#15213](#15213))


<!-- VADE_RISK_START -->
> [!NOTE]
> Low Risk Change
>
> This PR contains only version bumps and changelog updates from the
Changesets release automation, with no actual code changes.
> 
> - Deletes changeset markdown files consumed during release
> - Updates version numbers in package.json files (50.22.3→50.23.0,
3.4.2→3.4.3)
> - Adds changelog entries documenting previously merged changes
>
> <sup>Risk assessment for [commit
18f0132](https://github.com/vercel/vercel/commit/18f013287efb10cb34e666236f9e34f0c72d0c83).</sup>
<!-- VADE_RISK_END -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
anatrajkovska added a commit that referenced this pull request Feb 25, 2026
This PR is a follow up of #15074
and removes the dead code for the legacy SSO flow, as it is not used
anymore.

<!-- VADE_RISK_START -->
> [!WARNING]
> High Risk Change
>
> This PR removes legacy SSO/SAML login flow code (oauth.ts, saml.ts,
verify.ts, prompt.ts) which is dead code cleanup as stated, but removing
authentication-related code paths warrants careful review to ensure the
new flow fully replaces this functionality.
> 
> - Deletes entire oauth.ts, saml.ts, verify.ts, and prompt.ts files
handling legacy SSO login
> - Removes OAuth callback server, SAML login flow, and token
verification logic
> - Adds CODEOWNERS entries for login/logout/teams paths to
identity-and-access-management team
>
> <sup>Risk assessment for [commit
c75fa98](https://github.com/vercel/vercel/commit/c75fa9884892abf45494adec0fbbbd03a0770f17).</sup>
<!-- VADE_RISK_END -->
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.

5 participants