为什么我的gitlab作为OAuth2提供商的redirect_uri是http而不是https?

问题描述 投票:0回答:2

我想配置我的超集部署,以便用户可以使用 gitlab 作为 OAuth2 提供程序进行签名。

Superset 是一个 Flask 应用程序,它使用 authlib 来启用 OAuth2 (https://superset.apache.org/docs/installation/configuring-superset)。我遇到的问题是,虽然gitlab中配置的redirect_uri是https,但是使用的redirect_uri是http。

这是日志:

127.0.0.1 - - [16/8/2021:07:36:56 +0000]“GET /health HTTP/1.1”200 2“-”“curl/7.64.0” 2021-08-16 07:37:02,011:DEBUG:authlib.integrations.base_client.base_app:保存授权数据:{'redirect_uri':'http://my-superset-webserver/oauth-authorized/gitlab','url ': 'https://my-gitlab-webserver/oauth/authorize?response_type=code&client_id=[...]&redirect_uri=http%3A%2F%2Fmy-superset-webserver%2Foauth-authorized%2Fgitlab&scope=api+read_user+ read_api+read_repository+openid+profile&state=SOME_STATE', 'state': 'SOME_STATE'}

flask oauth-2.0 gitlab apache-superset authlib
2个回答
3
投票

我相信我也有类似的问题,并将其添加到

superset_config.py

# This will make sure the redirect_uri is properly computed, even with SSL offloading
ENABLE_PROXY_FIX = True

0
投票

如果您使用 Apache 的反向代理,请添加配置:

RequestHeader 设置 X-Forwarded-Proto“https”

© www.soinside.com 2019 - 2024. All rights reserved.