我得到了一个意外的参数“tenant”

2024-06-16 10:00:35 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用Azure Active Directory允许我公司的Microsoft域用户登录到我的Web应用程序。我收到一个错误,上面写着:

Message: AADSTS90130: Application ... is not supported over the /common or /consumers endpoints. Please use the /organizations or tenant-specific endpoint.

所以我做了一些研究,发现这个documentation表示我可以设置一个“tenant”参数,但是当我运行这个时:

blueprint = make_azure_blueprint(
    client_id="client_id_here",
    client_secret="client_secret_here",
    tenant="tenant_here"
)

我得到一个错误:

TypeError: make_azure_blueprint() got an unexpected keyword argument 'tenant'

有人知道我做错了什么吗?我该如何让蔚蓝的房客跳舞?你知道吗


Tags: ortheclientidsecretmakehere错误
1条回答
网友
1楼 · 发布于 2024-06-16 10:00:35

如果其他人遇到这个问题:我发现这个库在默认情况下实际上并不包含租户参数。只需进入天蓝.py在flask dance库中归档,并将两行更改为:

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),

相关问题 更多 >