nextcloud / integration_mattermost

Mattermost integration in Nextcloud
GNU Affero General Public License v3.0
19 stars 6 forks source link

Mattermost OAuth error : Host violates local access rules #19

Closed Jean28518 closed 11 months ago

Jean28518 commented 1 year ago

Great app!

But I get the following error, if I click on 'connect with mattermost' in the user settings.

Nextcloud log:

{"reqId":"b0gsrMzbS5o7lW9asGtt","level":2,"time":"2023-02-05T12:57:30+00:00","remoteAddr":"192.168.178.75","user":"jean","app":"integration_mattermost","method":"GET","url":"/index.php/apps/integration_mattermost/oauth-redirect?code=748ek3zqejyxtpe73jr95jaqfr9r5ftrsaz7yp9g83apd9w1d6hw&state=kawh3pkmtd","message":"Mattermost OAuth error : Host violates local access rules","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0","version":"25.0.3.2","data":{"app":"integration_mattermost"}}

Mattermost log:

{"timestamp":"2023-02-05 13:09:17.925 Z","level":"debug","msg":"Received HTTP request","caller":"web/handlers.go:156","method":"GET","url":"/oauth/authorize","request_id":"838wmf93x7yuprbgay1yk7695h","status_code":"302"}

Does anyone have an idea why?

(Using mattermost with docker container, nextcloud and mattermost are behind a caddy reverse proxy with self signed tls and use local domains)

julien-nc commented 1 year ago

Hi, By default, Nextcloud does not allow its server side to perform Http request to local domains. You can change that by setting the allow_local_remote_servers key to true in nextcloud/config.php. config parameter list

Any better?

kyteinsky commented 1 year ago

Hello @Jean28518, did it solve your issue?
I recommend hosting an online Mattermost instance though since a self-signed certificate may cause issues with the OAuth flow even after this allow_local_remote_servers is set to true.

kyteinsky commented 11 months ago

Closing stale issue.