Created
November 7, 2017 16:59
-
-
Save Plazmaz/a08656be4c8990ad094eac2b575c7242 to your computer and use it in GitHub Desktop.
Generate test credentials for bitbucket
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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