Error when connecting to exchange online

Hello, i have a script that i wish would automatically connect to exchange online. when i run it im greeted with this error:


if i input the credentials manually i get connected just fine.

ive been using this : Using Saved Credentials in Powershell Scripts (telstra.com.au)
to generate a secure password for the automated script login