Skip to content

AWS Amplify cannot connect to Bitbucket — OAuthToken exceeds 1000 character limit after Bitbucket JWT token change

3

After Bitbucket Cloud's OAuth 2.0 changes (gradually rolled out, confirmed broken as of 2026-08-05), the access tokens from client_credentials grant are now JWT format (~1879 characters). AWS Amplify's OauthToken parameter has a hard limit of 1000 characters, making it impossible to connect Bitbucket repositories.

How to reproduce

Following the official AWS guide: https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/integrate-a-bitbucket-repository-with-aws-amplify-using-aws-cloudformation.html

  1. Create OAuth Consumer in Bitbucket with required permissions
  2. Request token:
curl -X POST -u "KEY:SECRET" https://bitbucket.org/site/oauth2/access_token -d grant_type=client_credentials
  1. Token returned is now ~1879 characters (JWT format)
  2. Any attempt to use this token fails:
Error: "1 validation error detected: Value at 'oauthToken' failed to satisfy constraint: Member must have length less than or equal to 1000"

Affected surfaces

  • AWS CLI (aws amplify create-app / update-app)
  • AWS CloudFormation (AWS::Amplify::App OauthToken property)
  • AWS CDK
  • AWS Console (Amplify Hosting UI — connecting Bitbucket)

ALL methods fail with the same 1000-character validation error.

Token length comparison

PeriodToken FormatLengthAmplify Limit
Before 2026-05-04 (per Atlassian announcement)Opaque string~88 chars1000 chars (OK)
Confirmed working on 2026-07-30Opaque string~88 chars1000 chars (OK)
2026-08-05 (today)JWT~1879 chars1000 chars (FAIL)

Context

  • Bitbucket deprecated App Passwords on 2026-06-09
  • Bitbucket changed OAuth tokens to JWT format (announced 2026-05-04, gradually enforced)
  • Repository Access Tokens return "This API is not accessible by this authentication mechanism" because Amplify calls workspace-level APIs
  • There is currently NO viable workaround for new Bitbucket integrations with Amplify

Expected behavior

Amplify should increase the OauthToken maxLength limit, or provide an alternative connection mechanism compatible with Bitbucket's new token format.

References

Error Pages

This problem also exists in Amplify console, not just CFN and API This problem also exists in Amplify console, not just CFN and API

2 Answers
0

Following, as I have exact same scenario and errors:

  • I cannot provision new Amplify apps from Bitbucket because of the errors show in OPs post.
  • All of my existing deployments are also broken. Timing is the same, and affecting every workload in my organization.

answered a month ago

  • Hi Matt, it looks like this issue was fixed in AWS Amplify management console. Enjoy it.

0

It looks list Amplify team fixed this issue in AWS management console BUT still get error in Cloudformation.

7:24:23 AM | CREATE_FAILED           | AWS::Amplify::App           | AppF1B96344
Properties validation failed for resource AppF1B96344 with message:
#/OauthToken: expected maxLength: 1000, actual: 1879

❌  oo-xx failed: DeploymentError: Resource updates failed:

answered 23 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.