Windows Sync Login Error

Hello,

i have some Configuration Issue. My NextCloud runs behind a reverse proxy. If i configurate the Sync-Client and i logged in (Browser to create a “Token”) i get an internal Error Message (see Nextcloud log). if i use the internal IP adresse it works fine and i can configurate the client.

With the Web-Interface i don’t have any problems.

Nextcloud version (eg, 12.0.2): 18.0.1
Operating system and version (eg, Ubuntu 17.04): OpenSuse 15.1
Apache or nginx version (eg, Apache 2.4.25): Apache 2
PHP version (eg, 7.1): PHP 7.2

Is this the first time you’ve seen this error? (Y/N): Y

The output of your Nextcloud log in Admin > Logging:

{"reqId":"wb9b2zeEKHP9mCfjDI9J","level":3,"time":"2020-02-25T14:02:25+00:00","remoteAddr":"10.6.5.91","user":"test","app":"index","method":"GET","url":"/index.php/login/v2/grant","message":{"Exception":"Exception","Message":"Argument 1 passed to OC\\Core\\Controller\\ClientFlowLoginV2Controller::grantPage() must be of the type string, null given, called in /srv/www/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php on line 170","Code":0,"Trace":[{"file":"/srv/www/htdocs/nextcloud/lib/private/AppFramework/App.php","line":125,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\ClientFlowLoginV2Controller"},"grantPage"]},{"file":"/srv/www/htdocs/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Core\\Controller\\ClientFlowLoginV2Controller","grantPage",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"core.ClientFlowLoginV2.grantPage"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"_route":"core.ClientFlowLoginV2.grantPage"}]},{"file":"/srv/www/htdocs/nextcloud/lib/private/Route/Router.php","line":299,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"_route":"core.ClientFlowLoginV2.grantPage"}]},{"file":"/srv/www/htdocs/nextcloud/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/login/v2/grant"]},{"file":"/srv/www/htdocs/nextcloud/index.php","line":38,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/srv/www/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":109,"Previous":{"Exception":"TypeError","Message":"Argument 1 passed to OC\\Core\\Controller\\ClientFlowLoginV2Controller::grantPage() must be of the type string, null given, called in /srv/www/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php on line 170","Code":0,"Trace":[{"file":"/srv/www/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":170,"function":"grantPage","class":"OC\\Core\\Controller\\ClientFlowLoginV2Controller","type":"->","args":[null]},{"file":"/srv/www/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\ClientFlowLoginV2Controller"},"grantPage"]},{"file":"/srv/www/htdocs/nextcloud/lib/private/AppFramework/App.php","line":125,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\ClientFlowLoginV2Controller"},"grantPage"]},{"file":"/srv/www/htdocs/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Core\\Controller\\ClientFlowLoginV2Controller","grantPage",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"core.ClientFlowLoginV2.grantPage"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"_route":"core.ClientFlowLoginV2.grantPage"}]},{"file":"/srv/www/htdocs/nextcloud/lib/private/Route/Router.php","line":299,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"_route":"core.ClientFlowLoginV2.grantPage"}]},{"file":"/srv/www/htdocs/nextcloud/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/login/v2/grant"]},{"file":"/srv/www/htdocs/nextcloud/index.php","line":38,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/srv/www/htdocs/nextcloud/core/Controller/ClientFlowLoginV2Controller.php","Line":152},"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko","version":"18.0.1.3","id":"5e552c08ece04"}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

  'trusted_proxies' => 
  array (
	0 => 'PUBLICIP.ADRESS.REVPROXY',
  ),