There can be scenarios where the login works when using localhost, but fails with a Fully Qualified Domain Name (FQDN) with SSL enabled.
Example:
This issue occurs because when you log in using localhost and add a user as an administrator from the User List page, the system may create a user that does not belong to the domain.
For instance, based on the example above, a user such as "ABC\User" might be added instead of "TEST\User1" when Business Central is accessed via localhost.
When you log in using the FQDN (myserver.test.com), the login process expects a domain user, such as "TEST\User1". If this expected user does not exist, you will see the error:
“You do not have access to Dynamics 365 Business Central. Verify that you have been set up as a valid user in Dynamics 365 Business Central.”
The same behavior applies when there are no users in the database at all: localhost works, whereas the FQDN does not.
Best Practice:
Access Business Central using localhost initially, add the required domain users one by one, and then switch to using the FQDN(SSL enabled). This ensures that all expected domain users are correctly set up.
And login works there after with the domain user for FQDN with SSL enabled in the BC URL.