Why AD account gets locked on using custom MVC App in which REST API calls are made for TeamCity (on-premises) & BitBucket Server?
Hi,
I have created a custom MVC App using C# in which I have made REST API calls for TeamCity (on-premises) & BitBucket Server. I have generated the access tokens in TeamCity (on-premises) & BitBucket Server and I am using these access tokens for making REST API calls.
Whenever I execute the custom MVC App, the AD account gets locked. Error message "Account is locked because there were too many log-on attempts or password change attempts" is displayed in dialog box when I try to RDP into the server using the AD account.
Please let me know why the AD account gets locked.
Please sign in to leave a comment.
Hello,
The AD account lock is not caused by TeamCity, and depends on Account Lockout Policy that you have configured. It can have many causes, such as the account being used elsewhere with an old or incorrect password, or the account being used in several devices, between many others. If you are using the same AD account for both your application and also the Bitbucket server, it is possible that it is being locked because of that. To guide you through this troubleshooting process, i suggest you to go through the following article:
https://docs.microsoft.com/en-us/azure/active-directory-domain-services/troubleshoot-account-lockout
You can also check with your System administrator how you can adjust the Account Lockout Policy to accommodate your MVC App REST API usage and the organization needs:
https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/account-lockout-policy
If this doesn't work, a possible workaround for this might also be trying to use personal access tokens, if your TeamCity version supports it:
https://www.jetbrains.com/help/teamcity/configuring-your-user-profile.html#Managing+Access+Tokens . This way auth should stop at teamcity and not get all the way to AD. If you have a small amount of users for your use case, it might be useful.
Please let me know if you have any more questions or concerns,
Guilherme