Bitbucket OAuth Cloud
-
Go to https://bitbucket.org/accuknox-org/workspace/overview/ or, Craete a Bitbucket Workspace
-
Go to
Settings->Workspace Settings -
Click
Apps and Features->OAuth Clients - Permissions
Read- Account
- Repositories
- Pipelines
- Workspace Membership
- Pull requests
- Projects
- Create
OAuth Client- Client Name - Accuknox Dev
- Client ID -
- Client Token -
- Redirect Uri -
- Auth URL -
- API to Generate
Access Token- POST https://bitbucket.org/site/oauth2/access_token
- Auth - Basic - Username (client_id) Password (client_secret)
- Body - x-www-form-urlencoded
- grant-type - authorization_code
- code - from
- Response
{ "access_token": "ey", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "ey", "scope": "pipeline pullrequest project team repository account email", "scopes": "pipeline pullrequest project team repository account email" }
- API to get User Details
- GET https://api.bitbucket.org/2.0/user
- Auth - Auth Token
- API to List Repos
- GET https://api.bitbucket.org/2.0/repositories/{workspace}
- Auth - Auth Token
- API to Refresh
Access Token- POST https://bitbucket.org/site/oauth2/access_token
- Auth - Basic - Username (client_id) Password (client_secret)
- Body - x-www-form-urlencoded
- grant-type - refresh_token
- refresh_token - from PT.6
- Clone Repos
- git clone https://x-token-auth:@bitbucket.org//.git