Hiya, I'm using bitbucket cloud and I was previously using a powershell script to hit /branch-restrictions with a POST to set a few branch restrictions on new branches created via the script.
This used to work fine, but now with 2fa I can't seem to find a way without getting a 401 response. I understand my main password won't work now, but even a fully scoped app password doesn't work either?
This is a pretty important part of our workflow to protect branches from history rewrites etc. Please don't tell me I have to disable 2fa to be able to set some restrictions on a branch now?
Hi Steven,
Thanks for your question.
even a fully scoped app password doesn't work either
That's very odd; app passwords are intended for that purpose, so if they're not working, that's a problem!
It might be good to open a support ticket with the exact calls (passwords redacted, of course) you're making so we can take a look at your specific case.
Alastair
Hiya,
Thanks for your reply. The powershell script is using basic auth, which as I just discovered on your authentication docs isn't allowed on 2fa enabled accounts.
I can kind of see this from a security point of view. Trying to write a powershell script that uses oauth 2 is a bit of a pain, especially as the password grant flow doesn't allow the use of app passwords. Not quite figured out how I can have it hit a redirect url from a powershell script without doing something a bit horrible...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.