So I am trying to get generic oauth2 logins to work with Nextcloud. The documentation isn’t the best and it doesn’t follow the standard very well, but at least I made some progress. If anyone got some further ideas, please share.
So first I created a Oauth2 client in the Admin settings from Nextcloud. The Writefreely redirection URL seems to be nowhere documented, but it works with:
Then I copied over the client identifier and key into my WriteFreely config file and via trial and error and some googling already found some additional configuration settings:
[oauth.generic] client_id = *client identifier* client_secret = *secret* host = https://yournextclouddomain display_name = Nextcloud callback_proxy = callback_proxy_api = token_endpoint = /index.php/apps/oauth2/api/v1/token inspect_endpoint = /ocs/v2.php/cloud/user?format=json auth_endpoint = /index.php/apps/oauth2/authorize scope = allow_disconnect = false map_user_id = user-id map_username = map_display_name = map_email =
This already gets me quite far in the auth-flow, but upon redirection to WriteFreely I get the following JSON error:
"Post \"https://mynextcloud/index.php/apps/oauth2/api/v1/token\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)" Edit: I ran into Nextcloud’s build in bruteforce protection due to too much testing.
So now I am stuck :-/
Might be an issue with Nextcloud, but their Oauth2 server seems to work in general.