使用 Google OAuth API 使用 SSO 配置 Superset——缺少范围参数?

问题描述

我一直在尝试使用 Google OAuth API 登录 Superset(包括注册新用户),遵循以下说明:https://aungmt.medium.com/superset-with-google-oauth-3ba7a1c1f459

我所有的搜索结果都告诉我这个配置应该可以工作。但是,只要我单击登录按钮,就会收到 Error 400: invalid_request Missing required parameter: scope。我四次检查了我的 superset_config.py,它包含 'scope': 'openid email profile'

任何人都可以对此有所了解?

解决方法

我从 Superset Slack 频道收到了一些反馈。 @Daniel Gaspar

我想我在网上找到的教程都是针对旧版 Superset 的。配置中的某些键名与当前文档不匹配。以下是我从 Superset v0.38.0

开始的工作配置
OAUTH_PROVIDERS = [
{
    'name': 'google','icon': 'fa-google','token_key': 'access_token','remote_app': {
        'api_base_url': 'https://www.googleapis.com/oauth2/v2/','client_kwargs': {
            'scope': 'openid email profile'
        },'request_token_url': None,'access_token_url': 'https://accounts.google.com/o/oauth2/token','authorize_url': 'https://accounts.google.com/o/oauth2/auth','client_id': '###GOOGLE_KEY###','client_secret': '###GOOGLE_SECRET###'
    }
}

]