If you want to make your environment more secure, it's recommended to disable Legacy Authentication in Microsoft 365. Check this post to know how to do the same.