How to login nextcloud via rest api?

Im very new to Nextcloud. I have a webapp has a login page. It has own authentication system. But I want to use Nextcloud’s authentication to login my webapp. So I want to take the username and password from my webapp then send it to Nextcloud via http request to get a token or something useful result about successful login.
I checked out documentation but couldnt find any info about getting token with rest api.

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.


Thanks for reply. I found a kind of solution, i send 2 request to get ‘nc_token’; first request to get ‘requesttoken’ from response of http://xxx:8080/, then i use it in second http://xxx:8080/login post request body to get ‘nc_token’ from cookies. It is weird but ill find better solution i guess.

1 Like