Works perfectly with Nextcloud (did it by myself). This is gitea documentation → https://docs.gitea.io/en-us/oauth2-provider/#example
And this is nextcloud https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/oauth2.html
Will looks following in gitea, simply click on nextcloud icon and if you are logged in you will be logged in in gitea or asked for nextcloud user/password.