ROPC流:请求正文必须包含以下参数:'client_assertion'或'client_secret'

时间:2020-04-16 08:03:31

标签: python msal

我正在测试MSAL和ROPC流程。运行示例https://github.com/Azure-Samples/ms-identity-python-desktop时出现错误:

python username_password_sample.py parameters.json
invalid_client
AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'.

在遵循MS文档并使用 curl 时,我遇到了同样的问题。请检查my other question,SO社区在哪里帮助我解决了问题。将应用程序注册密码添加到curl请求后,我得到了有效的令牌,并且能够提取邮件。
令我感到困惑的是, parameters.json 文件中没有秘密

1 个答案:

答案 0 :(得分:1)

您错过了以下链接的第6步:https://github.com/Azure-Samples/ms-identity-python-desktop/tree/master/1-Call-MsGraph-WithUsernamePassword

enter image description here

如果应用程序设置为Public Client,则不需要密码。

有关更多详细信息,您可以阅读https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth-ropc#authorization-request供参考。

enter image description here