'Nextcloud - Automatically login the user via link

I use the nextcloud API in my app. I use it to create the user accounts on nextcloud, for example. The users registers in my app and should not have to create their own Nextcloud password (my app does that for them). Now I want to send the user to the Nextcloud page via a link. Can I create the link so that the user is automatically signed in? So e.g. if I pass a token via URL parameter?

Example:

https://myprivatenextcloud.com/...?user=user1&pwtoken=02jw9dj0w9djw02ejf0j0s9d2sldfk


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source