Skip to content

Instantly share code, notes, and snippets.

@Plazmaz
Created November 7, 2017 16:59
Show Gist options
  • Save Plazmaz/a08656be4c8990ad094eac2b575c7242 to your computer and use it in GitHub Desktop.
Save Plazmaz/a08656be4c8990ad094eac2b575c7242 to your computer and use it in GitHub Desktop.
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