This bug will be fixed in a future version.
For now:
- Close down VS2017
- Go to “C:\Users\{username}\AppData\Local\.IdentityService”
- Rename “IdentityServiceAdalCache.cache” as shown below. (for example just add an underscore to it)
- Restart VS2017 and log in.
NOTE: There are similar issues that this won’t resolve, but this worked for me.