There is now a change you have to be aware of.
Starting with Inventor 2020, to guarantee the Entitlement API calls work properly to get the UserName, call the Inventor API's Application.Login() function before or after webServiceMgr.Initialize() so the WebServices are fully initialized.
Otherwise, you may see a valid UserId, but an empty UserName when the user is already logged in.
Note: the Application.Login() function is hidden, so IntelliSense in Visual Studio will not list it.
And, if the user attempts to login when you have not used the Login() API call, they may get an error dialog that the service is not available: