Skip to content

Instantly share code, notes, and snippets.

@droidMakk
Last active January 8, 2018 05:16
Show Gist options
  • Save droidMakk/583cfe96d7f6f8a7e239764bf6f353ab to your computer and use it in GitHub Desktop.
Save droidMakk/583cfe96d7f6f8a7e239764bf6f353ab to your computer and use it in GitHub Desktop.
Generate OAuth Token : CURL - Bitbucket
Request
--------------------------------------------------------
curl -X POST https://bitbucket.org/site/oauth2/access_token \
-d grant_type=client_credentials \
-u user_key:user_secret \
--------------------------------------------------------
Response
--------------------------------------------------------
{
"access_token" : "your token",
"scopes" : "scope of token",
"expires_in" : "Time in Milliseconds",
"refresh_token" : "your refresh token",
"token_type" : "bearer"
}
---------------------------------------------------------
Token usage to clone a repository
---------------------------------------------------------
git clone https://x-token-auth:{ Your Token }@bitbucket.org/user_or_orgname/repo_name.git
Note :
---------------------------------------------------------
The Token Expires in an Hour
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment