Has anyone succeeded in using discourse as sso provider for nextcloud? Share recipe?

it’s not a perfect implementation, but it does its job for me:

https://github.com/paroga/user_discourse