【问题标题】:AADB2C90083: The request is missing required parameter: grant_typeAADB2C90083:请求缺少必需参数:grant_type
【发布时间】:2019-12-11 01:37:42
【问题描述】:

我正在尝试使用以下 URL 中提到的自定义策略在 Azure Active Directory B2C 中配置 ROPC 流。

https://docs.microsoft.com/en-us/azure/active-directory-b2c/ropc-custom

但我在测试 ROPC 策略时遇到以下错误。 { “错误”:“无效请求”, “error_description”:“AADB2C90083:请求缺少必需 参数:grant_type。\r\n相关 ID:b4153dfe-4296-4b68-850f-ee30ac4d86b0\r\n时间戳:2019-08-02 11:53:23Z\r\n" }

【问题讨论】:

  • 您是否正在使用 Native App 验证 ROPC 场景?
  • 尝试添加grant_type = password
  • 我已经添加了 grant_type = 密码,但不起作用。
  • 我也有同样的问题。你能解决这个问题吗?如果是,解决方法是什么?
  • 对我来说同样的错误,我必须再试 2 或 3 次,它可以工作

标签: azure azure-active-directory azure-ad-b2c


【解决方案1】:

我得到了同样的错误,然后我意识到它应该是 GET 请求并且我正在发送 POST。确保您发送的请求类型正确。

【讨论】:

【解决方案2】:
https://<your-tenant-name>.b2clogin.com/<your-tenant-name>.onmicrosoft.com/oauth2/v2.0/token?p=B2C_1A_<POLICY_NAME>&username=xxxxx&password=xxxxx&grant_type=password&scope=openid <NativeClient_App_ID> offline_access&client_id=<NativeClient_App_ID>&response_type=token id_token

在上面的 url 中添加您的租户名称、ROPC 登录策略名称、用户名和密码以及您的本地客户端 ID。

现在尝试发送请求并检查。

【讨论】:

  • 在请求标头中,确保存在 content-type 参数。 Content-Type: application/x-www-form-urlencoded
猜你喜欢
  • 2012-06-27
  • 1970-01-01
  • 1970-01-01
  • 2017-12-01
  • 1970-01-01
  • 1970-01-01
  • 2014-06-29
  • 1970-01-01
  • 2019-09-14
相关资源
最近更新 更多