WireCloud redirect url with proxy

独自空忆成欢 提交于 2020-01-05 03:48:10

问题


Where can I manually set the redirect_uri that is part of the url parameters when clicking on sign in in the default WireCloud setup?

We want to show our platform to the internet and need to address our WireCloud server via our proxy. The problem now is, that not the proxy url gets used as redirect url but the internal server url. This leads to the error {"state": "eCUfYmpXnDV34IVR1P8Vtt2Ke8Xhoxtm", "error": "mismatching_redirect_uri"} (HTTP 400).


回答1:


Add the following lines into the settings.py file:

USE_X_FORWARDED_HOST = True
USE_X_FORWARDED_PORT = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

this will configure WireCloud to trust the following headers: X-Forwarded-Host, X-Forwarded-Port and X-Forwarded-Proto. These headers are usually provided by the proxy servers when calling the backend service.

If you prefer to no rely on these headers, you can set the specific values in the settings.py file using the following settings instead:

FORCE_PROTO = 'https'
FORCE_DOMAIN = 'my.domain.com'
FORCE_PORT = 8000


来源:https://stackoverflow.com/questions/37135806/wirecloud-redirect-url-with-proxy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!