Windows Clients Wont Login

Nextcloud version: 15.0.7
Operating system and version: Ubuntu 18.04
Apache or nginx version: Apache/2.4.29
PHP version: PHP 7.2.17

The issue you are facing: I am unable to log in to my server client through any of the windows clients. I have only been able to log in using the direct IP address. When looking through the logs for apache2 and Nextcloud, no errors are generated. I had a small error when the client was trying to access the server over port 80. This is due to port 80 being blocked, I added a redirect to 443 into the apache conf file and that went away.

When right clicking on the “grant access” screen and choosing “view source,” then I am able to get a response from Nextcloud which states: 'Access forbidden, state token mismatch."

I searched the forum for information related to “state token mismatch” and added a few rewrite lines into the reverse proxy configuration. Nextcloud is fully accessible from any of my linux hosts, both on network and off the network. There is something specific about my windows hosts that are not able to access the server.

Is this the first time you’ve seen this error?: Yes

Steps to replicate it:

  1. Log in with a new account
  2. Enter username and password
  3. Give 2FA
  4. Grant access
  5. Watch it spin

The output of your Nextcloud log in Admin > Logging:

It’s blank. Only thing showing in there are a few messages about timezone, which have been corrected.

The output of your config.php file in /path/to/nextcloud: https://pastebin.com/GqJ6A1j9
The output of your Apache log in: Access.log (last 45 lines when I tried to log in) = https://pastebin.com/AtYUWUQz

And that’s it. I’m not sure what’s really going on with this yet. Any clues?

I’ve since upgraded to NC 16 and I am still receiving the same issues. Anyone think of any troubleshooting that I might be able to do?

Edit: I’ve figured out more information to this issue. Turns out that the Windows client is doing something the URL that it’s trying to connect too. It strips out the subdomain and the certificate settings from the URL as well. Not sure how much I’m in to trusting this client on windows when it wont connect over HTTPS even when the website will connect right away and not stip out the cert file or subdomain.

Edit #2: I have fixed the issue by going in and editing the nextcloud.cfg file to include the correct subdomain. Now everything runs correctly and resolves as it should. I’ll try to open an issue/search for it on github.