Check out OIDC, you can configure your webapp to authorize users via Nextcloud.
E.g. I use it with gitea. Gitea will authorize users via Nextcloud.