I set this up a few years ago so details are hazy at best (I cannot remember) so far as I recall I just used an app password nothing fancy.
I do know Google revokes all app passwords if the main account password changes. It might be worth revoking the original - creating a new one, set flarum to use ssl, port as above and new app password.
Sorry I cannot help further, I set all this up years ago and have just left it alone.