You may get such error when you start configuring Server-Side Rerouting.
3 things to check to resolve this issue
1. Ensure that you are using the correct password. Use it to log into your Office 365 portal.
2. Your password should follow Microsoft's password complexity guideline.
Weak passwords(Ex. NbAKKadSoP) were proven to result in the above error.
Your password should be at least 8 characters including numbers, letters(lowercase and uppercase) and special characters.
3. Your user account should have a Global Administrator role.
To confirm this, you have to open your user account's details in the Office 365 Admin portal.
Click Manage Roles
Select Global Administrator, then hit Save.