Does the account you are using to connect to o365 have MFA set up on it? If so you’ll need an app password to use here