我试图使用Azure Active Directory允许我公司的Microsoft域用户登录我的Flask webapp。我收到的错误是:
消息:AADSTS90130:/ common或/ consumer端点不支持Application ....请使用/ organization或特定于租户的端点。
所以我做了一些研究,发现这个documentation说我可以设置一个“租户”参数,但当我运行时:
blueprint = make_azure_blueprint(
client_id="client_id_here",
client_secret="client_secret_here",
tenant="tenant_here"
)
我收到一个错误:
TypeError:make_azure_blueprint()得到一个意外的关键字参数'tenant'
有谁知道我做错了什么?如何在Flask Dance中设置Azure租户?
如果有其他人遇到这个问题:我发现默认情况下该库实际上并没有包含租户参数。您可以通过简单地进入flask舞蹈库中的azure.py文件并将两行更改为以下内容来添加它:
authorization_url="https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize".format(tenant=tenant),
token_url="https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token".format(tenant=tenant),