代码之家  ›  专栏  ›  技术社区  ›  sirdank ben

b2c有效时的“无效密码”

  •  0
  • sirdank ben  · 技术社区  · 7 年前

    我正在尝试将本地帐户登录添加到自定义策略,而不添加本地帐户注册。我创建了一个本地帐户注册策略,并使用它创建了一个本地帐户。现在,如果我将这些凭据放入我的自定义策略,它将不起作用,但我得到的唯一错误是“无效密码”。如果我在内置的本地帐户策略中输入相同的凭据,它将使我登录。

    我甚至在自定义策略中添加了注册支持,删除了我的用户,通过自定义策略注册,并尝试使用我刚刚创建的凭据登录:它仍然说“无效密码”。如何进一步排除故障?我已经连接了应用程序的细节,但是输出并不是很有帮助。

    {
      "Kind": "HandlerResult",
      "Content": {
        "Result": false,
        "RecorderRecord": {
          "Values": [
            {
              "Key": "Validation",
              "Value": {
                "Values": [
                  {
                    "Key": "SubmittedBy",
                    "Value": null
                  },
                  {
                    "Key": "ProtocolProviderType",
                    "Value": "SelfAssertedAttributeProvider"
                  },
                  {
                    "Key": "TechnicalProfileEnabled",
                    "Value": {
                      "EnabledRule": "Always",
                      "EnabledResult": true,
                      "TechnicalProfile": "login-NonInteractive"
                    }
                  },
                  {
                    "Key": "ValidationTechnicalProfile",
                    "Value": {
                      "Values": [
                        {
                          "Key": "TechnicalProfileId",
                          "Value": "login-NonInteractive"
                        },
                        {
                          "Key": "MappingDefaultValueForClaim",
                          "Value": {
                            "PartnerClaimType": "client_id",
                            "PolicyClaimType": "client_id"
                          }
                        },
                        {
                          "Key": "MappingDefaultValueForClaim",
                          "Value": {
                            "PartnerClaimType": "resource",
                            "PolicyClaimType": "resource_id"
                          }
                        },
                        {
                          "Key": "MappingPartnerTypeForClaim",
                          "Value": {
                            "PartnerClaimType": "username",
                            "PolicyClaimType": "signInName"
                          }
                        },
                        {
                          "Key": "MappingPartnerTypeForClaim",
                          "Value": {
                            "PartnerClaimType": "password",
                            "PolicyClaimType": "password"
                          }
                        },
                        {
                          "Key": "MappingDefaultValueForClaim",
                          "Value": {
                            "PartnerClaimType": "grant_type",
                            "PolicyClaimType": "grant_type"
                          }
                        },
                        {
                          "Key": "MappingDefaultValueForClaim",
                          "Value": {
                            "PartnerClaimType": "scope",
                            "PolicyClaimType": "scope"
                          }
                        },
                        {
                          "Key": "MappingDefaultValueForClaim",
                          "Value": {
                            "PartnerClaimType": "nca",
                            "PolicyClaimType": "nca"
                          }
                        }
                      ]
                    }
                  },
                  {
                    "Key": "Exception",
                    "Value": {
                      "Kind": "Handled",
                      "HResult": "80131500",
                      "Message": "Invalid username or password.",
                      "Data": {}
                    }
                  }
                ]
              }
            }
          ]
        },
        "Statebag": {
          "Complex-CLMS": {},
          "ComplexItems": "_MachineEventQ, REPRM, TCTX, S_CTP, M_EXCP"
        },
        "Exception": {
          "Kind": "Handled",
          "HResult": "80131500",
          "Message": "Invalid username or password.",
          "Data": {}
        },
        "PredicateResult": "False"
      }
    },
    
    1 回复  |  直到 7 年前
        1
  •  0
  •   Chris Padgett    7 年前

    造成这种情况的常见原因是 框架的代理识别经验 应用于 the extension file 自定义策略。

    您必须确保:

    1. 你有 added the ProxyIdentityExperienceFramework application 到您的Azure AD B2C目录。
    2. 你有 configured the application identifier ,而不是对象标识符 框架的代理识别经验 扩展文件中的应用程序。

    的配置 框架的代理识别经验 应用程序很重要,因为 the login-NonInteractive technical profile 通过使用资源所有者密码凭据授予类型向您的Azure AD B2C目录发送访问令牌请求,对本地帐户进行身份验证。

    与所有对Azure AD目录的访问令牌请求一样,此访问请求必须包含客户端应用程序的应用程序标识符(即 框架的代理识别经验 应用程序)和资源应用程序(也就是 框架的代理识别经验 应用程序)。

    推荐文章