There is an option to generate “application passwords” in the web GUI in the security tab. Choose a name and click “create new app password”. You will see a auto generated password. Use this, it will not ask for two factor for this password. Remember that you need to save it somewhere if you want to use it later, once you hide it in the GUI, you can’t display it again
Best practice is to generate one for each app, or device you want to connect. Doing that, you can easily revoke access in case of theft of a device without changing your login password.