Clear your browsing data

reboot

%localappdata%\Microsoft\Credentials – delete this folder.

reboot

Control Panel, Credential Manager, Windows Credentials, Remove the entries there.

reboot

Computer\HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\Identity

Delete the Identity key

reboot

After all of that, it may still be an issue.

So, weird, but click the user in the Start Menu, Change Account Settings, then click Accounts again on the left, then Email and Accounts in the center section.

When we did this, it still showed the user connected to Microsoft accounts there. We had to expand and collapse this section to get it to reset and have nothing listed there.

Then after that, Office licensing logon worked perfectly.