aws-amplify / aws-amplify/amplify-hosting

Raise OAuth/JWT Access Token Length

Open
#4,105 1 comment 4 reactions 0 assignees View on GitHub
feature-request
Dominant language
Dockerfile
Stars
481
Forks
123
PR merge metrics
No merged PRs in 30d

Description

### Before opening, please confirm:

- [x] I have checked to see if my question is addressed in the [FAQ](https://github.com/aws-amplify/amplify-hosting/blob/master/FAQ.md).
- [x] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-hosting/issues?q=is%3Aissue+).
- [x] I have removed any sensitive information from my code snippets and submission.

### Amplify Hosting feature

Git providers

### Is your feature request related to a problem? Please describe:

Yes. As of Bitbucket Cloud's OAuth 2.0 / token-authentication overhaul (CHANGE-3052, enforced May 4, 2026 and rolled out gradually after), Bitbucket now issues long JWT-format OAuth access tokens. A current Bitbucket OAuth access token is ~1900+ characters.

Amplify's oauthToken field on CreateApp/UpdateApp has a maximum length of 1000 characters. As a result, Amplify rejects every current Bitbucket token, so it can no longer create or refresh the read-only deploy key and webhook that Bitbucket-connected apps depend on. The practical impact:

- All existing Bitbucket-connected apps fail their builds at clone time (Permission denied (publickey) / Unable to clone repository due to user error code: 128), because the repo's Amplify deploy key can no longer be maintained.
- Reconnecting a repository in the console re-prompts for Bitbucket authorization and never completes.
- Creating a new Bitbucket-connected app fails the same way (console, CLI, CloudFormation, and CDK are all affected, since they all funnel through the same oauthToken field).

This appears to affect every Amplify customer using Bitbucket Cloud, not a single account.

Reproduction

- Create/select an Amplify app connected to a Bitbucket Cloud repo.
- Mint a Bitbucket OAuth 2.0 access token (client_credentials) scoped repository:admin, webhook, pullrequest, project.
- Pass the same token to Amplify via `aws amplify update-app --oauth-token ...`

This results in

ValidationException: 1 validation error detected: Value at 'oauthToken'
failed to satisfy constraint: Member must have length less than or equal to 1000

### Describe how you'd like this feature to work

Any one of the following would restore Bitbucket support:

- Raise the oauthToken maximum length on CreateApp/UpdateApp to comfortably accommodate Bitbucket Cloud's current JWT access-token size (e.g., 4096+), and confirm the console OAuth flow stores the full token.
- Add a first-class Bitbucket token-based connection analogous to the GitHub App path (accessToken), so a Bitbucket API token / app installation is used instead of storing a long OAuth token in a length-limited field.
- Update the Bitbucket integration to exchange/refresh tokens server-side rather than persisting a full user OAuth token in the 1000-char field.

Contributor guide

Open the contributing guide

Research direction

Start with the Amplify CreateApp/UpdateApp API and the `aws amplify update-app --oauth-token` reproduction described in the issue. Compare the proposed token-length, token-based connection, and server-side exchange approaches, then verify the chosen approach against console, CLI, CloudFormation, and CDK flows. Done means current Bitbucket Cloud tokens are accepted and connected apps can create or refresh their repository integration.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
api, cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.