在将Airflow更新为版本2.2.5后,我遇到了Google登录的问题,而在1.0.0.版本中需要使用Authlib作为约束
在这里我以前的webserver_config.py
import os
from airflow.www.fab_security.manager import AUTH_OAUTH
# from flask_appbuilder.security.manager import AUTH_OAUTH
from airflow.configuration import conf
basedir = os.path.abspath(os.path.dirname(__file__))
# The SQLAlchemy connection string.
AUTH_TYPE = AUTH_OAUTH
AUTH_USER_REGISTRATION = True
AUTH_USER_REGISTRATION_ROLE = "Viewer"
AUTH_USER_REGISTRATION_ROLE_JMESPATH = "contains(['$$CUSTOM_ADMIN_EMAIL$$'], email) && 'Admin' || contains(['$$CUSTOM_USER_EMAIL$$'], email) && 'User' || 'Viewer'"
CSRF_ENABLED = True
# The SQLAlchemy connection string.
SQLALCHEMY_DATABASE_URI = conf.get('core', 'SQL_ALCHEMY_CONN')
OAUTH_PROVIDERS = [
{'name': 'google', 'icon': 'fa-google', 'token_key': 'access_token',
'whitelist': ['@$$CUSTOM_DOMAIN$$'],
'remote_app': {
'client_id': '$$CLIENT_ID$$',
'client_secret': '$$CLIENT_SECRET$$',
'api_base_url': 'https://www.googleapis.com/oauth2/v2/',
'client_kwargs': {
'scope': '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'}
},
]尝试登录后,它将显示:

使用此错误日志:
2022-0406:44:39,729 {views.py:671}错误-返回OAuth用户信息: missing_token:
有人知道是bug还是我错过了更新后要在代码中进行的更新?
发布于 2022-04-06 15:10:40
谢谢@轻柔。我们更新了Airflow 2.2.5的cosntraints,现在用Authlib=1.0.1刷新图像!
发布于 2022-04-06 11:58:45
这是个错误,刚才已经修好了。请将Authlib升级到1.0.1。
https://stackoverflow.com/questions/71762331
复制相似问题