I was getting a legacy password prompt with the command

Connect-MsolService

As per some suggestions I uninstalled Windows Azure AD from the Add Remove Programs.

Also ran this command which sometimes does help

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Now I wanted to install the msonline module but it was not working using Insall-Module command

Install-Module MSOnline

connect-msol

The following command helped resolve the issue

Find-Module MSOnline | Install-module

Helpful Resources

Connect-msolservice-may-fail-when-mfa-is-enabled