Hi cemsimsek,
Thanks for reaching out in Apple Support Communities. I understand that you're having trouble using Touch ID on your Mac when you're connected to the power cable, but Touch ID works as expected if you're using battery power. I know how important it is to be able to use Touch ID on your Mac all the time; I'd like to help. I'd recommend that you use these steps to reset the SMC of your Mac, then test Touch ID when connected to power: How to reset the SMC of your Mac
If the behavior continues, please provide the following details:
What happens when you try to use Touch ID and you're connected to a power cable?
Do you see an error message? If so, what does it say?
Which macOS version is installed on the Mac?
Best Regards.