'Bitbucket - How to get access token?

I am developing a javascript application ( electron , react ) in which i want to show a user his bitbucket repositories. I can show all public repositories simply using url "https://api.bitbucket.org/2.0/repositories/{username}" . But I need private repositories too. How to get them ? I need to get access token for it. How to get tokens using user credentials ???



Solution 1:[1]

I think this discussion would help you in determining what you might need (but not exact)

https://community.atlassian.com/t5/Bitbucket-questions/I-am-unable-to-find-HTTP-access-tokens-in-my-profile/qaq-p/2004278

Apparently, for personal bitbucket account, we only have the option to use api-tokens

Solution 2:[2]

For obtaining Access token you can obtain from this links

https://bitbucket.org/site/oauth2/authorize
https://bitbucket.org/site/oauth2/access_token

Before this you need to login in you account. For this you also need to access permissions uisng curl and terminal(not sure).In some cases token expire in an hour and you will get 401 response.Then you need to refresh tokens

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 JS_Rudra
Solution 2 CyberAbhay