{"type": "error", "error": {"message": "Access token expired."}}
this is invalid,I tried to follow the guidelines but still can't solve it.Because I can't set valid time and permissions
G'day!
Welcome to the Bitbucket Cloud Community! :)
The correct procedure to follow to create an OAuth access token can be found at the link below and is as follows:
https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/
From your profile avatar in the bottom left, click on the workspace in the Recent workspaces list or click All workspaces to open an entire list from which to choose.
Click Settings on the left sidebar to open the Workspace settings.
Click OAuth consumers under Apps and features on the left navigation.
Click the Add consumer button.
The system requests the following information:
Name: The display name for your consumer. This must be unique within your account. This is required.
Description: An optional description of what your consumer does.
Callback URL: Required for OAuth 2.0 consumers.
When making requests you can include a call back URL in the request:
If you do include the URL in a request it must be appended to the same URL configured in the consumer. So if your consumer callback URL is example.com/add-on the URL in your request must be something similar to example.com/add-on/function.
If you don't include the URL in the request we redirect to the callback URL in the consumer.
URL: An optional URL where the curious can go to learn more about your cool application.
Click Save. The system generates a key and a secret for you.
Toggle the consumer name to see the generated Key and Secret value for your consumer.
Once you have the Key and Secret value generated, you can then request the access token by running an API command based on the OAuth flow you are using:
https://developer.atlassian.com/cloud/bitbucket/oauth-2/
For example - client credentials flow:
curl -s -X POST -u "client_id:secret" https://bitbucket.org/site/oauth2/access_token -d grant_type=client_credentials
Hope this helps.
Cheers!
- Ben (Bitbucket Cloud Support)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.