Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Generate test credentials for bitbucket
#!/bin/bash
CLIENT_ID=""
CLIENT_SECRET=""
if [[ ! $1 ]]
then
echo "Please visit the following url to generate a code:"
echo "https://bitbucket.org/site/oauth2/authorize?client_id=$CLIENT_ID&response_type=code"
else
curl -X POST -u "$CLIENT_ID:$CLIENT_SECRET" \
https://bitbucket.org/site/oauth2/access_token \
-d grant_type=authorization_code -d code=$1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.