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?
I am addressing this currently in 2 steps:
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
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.
Hey @suraj !
Just came across this thread and found that your question was left unanswered, I hope you have already found how API Keys can be generated.
In case not, here are some resources that can help you with this:
API Keys for Organizations:
Access to admin.atlassian.com. Select the correct organization if you have more than one.
Go to Settings > API keys.
Click Create API key in the top right.
Enter a name that you’ll remember to identify the API key.
Change the expiration date if you'd like by picking a new date under Expires on. By default, the key expires one week from the creation date.
Select Create to save the API key.
Copy the values for your Organization ID and API key. You'll need those to use the API key.
Keep in mind it isn't possible to view the token after closing the creation dialog for security purposes.
API Keys For Products:
To create an API Key to use in your Atlassian Cloud products, you must:
Log in to https://id.atlassian.com/manage-profile
Click Create API token.
From the dialog that appears, enter a memorable and concise Label for your token and click Create.
Click Copy to clipboard, then paste the token to your script, or elsewhere to save
You can find more information about those in the following help articles:
Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...
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