Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Retrieve list of users with two step verification enabled on Bitbucket

Hello - At our organization, we are trying to get all the employees to enable 2FA for their bitbucket accounts. We are looking for a way to validate if a user has enabled 2FA or not. At the moment, i can get this done only in 1 way, that is by getting Atlassian Access - I can enforce and get a report from Managed Accounts page.

 

Is there an API or a place that can provide generate a report of al users who enabled 2FA themselves on Bitbucket?

3 answers

I am addressing this currently in 2 steps:

Step 1:

Running the curl requests (for page 1 and page 2 - because I know the number of users on our account is less than 200. Number of users per page is hard limited to 100 by Atlassian)

 

curl -s --user <Username>:<ApiKey> "https://api.bitbucket.org/2.0/teams/<Org>/members?pagelen=100&page=1" | json_pp | pbcopy

 

curl -s --user <Username>:<ApiKey> "https://api.bitbucket.org/2.0/teams/<Org>/members?pagelen=100&page=2” | json_pp | pbcopy

Paste the contents in an excel after each curl request

Step2:

Apply filters and look for has_2fa_enabled flag for each user and filter them 

 

To make my life easier I wrote a py script that can do this for me and send list to slack channel. 

suraj I'm New Here Aug 10, 2021

How do I generate the API keys, the password didnt work here ? and this api endpoint still working. The docs says its deprecated.

That would help me a lot at this point

0 votes

Hello @Ganesh Narasimhadevara,

Thanks for reaching out.

I'm not sure there's a reporting mechanism available for this yet. However, you can enforce two-factor authentication for a Bitbucket team if it is on a Premium plan.

Hope this helps.

Cheers,
Daniil

That would be an extremely interesting feature to be added

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,736 views 10 16
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you