This tutorial will show you how you can use your and your friend's Plex login to login to Nextcloud.
First you need to setup this piece of software, you can install it natively or use my docker for which you can find the tutorial here.
If you use unRAID you can add https://github.com/Starbix/docker-templates to your template repositories if you want to use the docker template.
You need to enable LDAP user and group backend
in Nextcloud which is an official app.
Then go into the LDAP user and group backend
settings and set like the following pictures:
Use the IP your LDAP for Plex instance runs on
Note: It doesn't add the Plex users to the Plex.tv group automagically, you need to do that manually.