hot to git clone with oauth? how to create token for this kind of use? Edited

Is not clear here... how to create the access token,

Any help is appreciated.

1 answer

This widget could not be displayed.

Hi Dennis, cloning with OAuth looks like:

$ git clone https://x-token-auth:{access_token}@bitbucket.org/user/repo.git

The string x-token-auth is required as a substitute for the username.

OAuth needs a key and secret, which together are know as an OAuth consumer. To create a consumer, do the following:

  1. In your Bitbucket account, navigate to your avatar in the bottom left and click Bitbucket settings.
  2. In the left navigation panel, click OAuth > Add consumer.  
    The system will ask you for name, description, callback URL and URL.

  3. Click Save. The system generates a key and a secret for you.
  4. Toggle the consumer name to see the generated Key and Secret value for your consumer.

Let us know if you have any more questions or if you're stuck somewhere.

Best regards,

Ana

what should we do with that Key and Secret then ? in the URL you are talking about access_token and then you are giving us Key and Secret ?


The best would be if you can make a example URL of how it looks like

thanks

An excessive incomplete @Ana Retamal Ortiz's answer.

The OAuth credentials are easy to create, but the auth_token is what you have never touched.

@Amir Koklanfor generating the token you can use your consumer key as key in the following address:

https://bitbucket.org/site/oauth2/authorize?client_id={key}&response_type=token

It will ask you for permissions according what you have chosen on creating the consumer.

In the URL you will find the access token that you can use later in

git clone https://x-token-auth:{access_token}@bitbucket.org/user/repo.git

Can you please explain how to access that URL?  I am new to this and I am trying to build a script that declines a PR but I need the OAuth.  I have the key and secret how to I use that URL to get the token?

Is mandatory to create the OAuth2 credentials accessing to your accout.

Follow the steps in https://community.atlassian.com/t5/Bitbucket-questions/Re-hot-to-git-clone-with-oauth-how-to-create-token-for/qaq-p/697127/comment-id/21947#M21947

 

The callback URL can be any URL; you can use http://example.com.

 

When you call https://bitbucket.org/site/oauth2/authorize?client_id={key}&response_type=token (the key value for client_id is your OAuth consumer key), you will find the callback url with the params sent by BitBucket. One of these params is the access token.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

1,214 views 8 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you