Prevent Users from accessing using Mobile Phone (IOS,Android,...)

are there way to prevent users from using Mobile to login/show data in nextcloud for security and privacy reasons

Afaik it is not possible to differentiate between the end-devices from within Nextcloud.
If you want to block access to Nextcloud, you should block connections from your Wifi access points using a firewall rule etc.

why? like based on user agent ?!

Check out the app file access control.

The user agent string is not reliable and can easily be overwritten by e.g. user agent switcher apps.

we are speak about normal users not pro ,and what about blocking apps that (if) based on API?

Well… don’t do that. I have to agree to @j-ed. Don’t base your security or any other policy, you’d like to force on your users, on a feature that simply doesn’t ensure that!

If you cite security reasons, than you really can’t rely on the user agent string from any client that comes along… I don’t even see a good reason for it to be part of the file access control app anyway, it’s not effective.

You would have to build your own Nextcloud-app (and push it to a store) with different user agent string or pass through a proxy or something that changes the user-agent string.

However, even more perfect systems won’t prevent your users getting creative and find a way around it, the internet is full of such strories.

Actually, According to audit log it can be possible by using WAF. Because audit log shows user agent. If it is known, so a filter can be set in WAF as rule. Or, someone can develop an app to filter connection coming to nextcloud site


  • “reqId”:“wBRLk4wLiVaMHAFaZLts”,
  • “level”:1,
  • “time”:“06.07.2022, 13:49:29”,
  • "remoteAddr" : “XXXXXX” ,
  • “user”:"–",
  • “app”:“admin_audit”,
  • “method”:“GET”,
  • “url”:"/nextcloud/apps/files_sharing/publicpreview/3ZcbiLNdc8TNTba?x=828&y=726&a=true&file=TEST.PNG&scalingup=0",
  • “message”:“Preview accessed: “/TEST.PNG” (width: “828”, height: “726” crop: “”, mode: “fill”)”,
  • userAgent”:“Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1”,
  • “version”:“”

Honestly, I would like to have this app.