当我尝试进行身份验证并使用“ acquire_token_with_username_password”方法从Azure AD获取令牌时,出现以下错误:
请求正文必须包含以下参数:“ client_assertion”或“ client_secret”。
我正在传递客户端ID。我在其他一些帖子中读到,问题可能是该应用程序应该注册为“本地”应用程序而不是Web应用程序,但是该发布是2年前的,我没有在Azure的应用程序属性中看不到任何地方来指定它是本机应用程序。我通过调用在变量中传递ID:
token = auth_context.acquire_token_with_username_password(resource, username, password, clientId)
我在“ acquire_token_with_username_password”中看不到要传递client_assertion或client_secret的任何地方,更不用说我不确定要放在哪里。