Furthermore, I just want to update a free app and I don't think there are no alternatives.
The credit card I had inserted time ago expired, and I don't want to insert any credit card info on a shared computer. The only thing I didn't try was putting a valid credit card in the payment settings of my Apple ID. I tried signing out, restarting, enabling two factors authentication, removing the password prompt in the settings, but nothing made any difference. I've tried a lot of tricks, all the ones that came out when you google for this problem. If I type my Apple ID and my password in place of that, after 30 seconds it prompts again for the same information, in the same way. When I open the Apple Store it starts prompting for Apple ID and password, and the Apple ID field is automatically filled with the previous Apple ID, the one I signed out. I urgently need to be able to develop for iOS 13, and for this reason, I need to update XCode to the latest version. I logged out and I logged in with my Apple ID. The App Store doesn't show any more detailed information about it, but, in my case, the Apple ID shown when asking the password (grayed out in the textbox) seems to.
The Mac was previously associated with another Apple ID.