【问题标题】:Microsoft.IdentityModel does not support a B2C issuer with 'tfp' in the URIMicrosoft.IdentityModel 不支持 URI 中带有 \'tfp\' 的 B2C 颁发者
【发布时间】:2022-11-01 20:15:31
【问题描述】:

我正在尝试运行 WebApp B2C 示例: https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/1-WebApp-OIDC/1-5-B2C

当我尝试登录时,我收到以下错误:

IDX40002: Microsoft.IdentityModel does not support a B2C issuer with 'tfp' in the URI. See https://aka.ms/ms-id-web/b2c-issuer for details.

如果我将Instance 编辑为https://myHost.b2clogin.com,我会得到:

AADSTS50011: The redirect URI 'https://myHost.b2clogin.com/1c2009bb-7e35-4a0e-9f22-xxxxxxxxx/oauth2/authresp' specified in the request does not match the redirect URIs configured for the application 'c24b0337-0bd9-45ee-8376-xxxxxxxxx'. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal. Navigate to https://aka.ms/redirectUriMismatchError to learn more about how to fix this.

【问题讨论】:

  • 请检查 azure 应用注册中给出的重定向 URI 是否与您请求的匹配。第二条错误消息显然是这样说的。
  • https://myHost.b2clogin.com/1c2009bb-7e35-4a0e-9f22-xxxxxxxxx/oauth2/authresp 重定向 uri?!?

标签: azure-ad-b2c azure-ad-b2c-custom-policy azure-b2c


【解决方案1】:

我试图在我的环境中重现相同的结果并得到以下结果:

我通过IEF Setup App 部署了自定义策略启动包,方法是输入我的 Azure B2C 租户名称,如下所示:

当我在门户中检查时,自定义政策成功创建如下:

现在我注册了一个名为的 Azure AD B2C 应用webapp1如下:

我添加了重定向 Uri到上面的应用程序如下:https://localhost:44316/signin-oidc

现在,我跟着同一个链接您提到并通过修改部署了一个示例 B2C Web 应用程序appsettings.json文件如下:

"AzureAdB2C": {
    "Instance": "https://sridevib2c.b2clogin.com",
    "ClientId": "9986e76d-bxx7-4x6x-bxx7-3d8xxxxx9a45",
    "Domain": "sridevib2c.onmicrosoft.com",
    "SignedOutCallbackPath": "/signout/B2C_1A_SIGNUP_SIGNIN",
    "SignUpSignInPolicyId": "B2C_1A_SIGNUP_SIGNIN",
    "ResetPasswordPolicyId": "B2C_1A_PASSWORDRESET",
    "EditProfilePolicyId": "B2C_1A_PROFILEEDIT" // Optional profile editing policy
    //"CallbackPath": "/signin/B2C_1A_SIGNUP_SIGNIN"  // defaults to /signin-oidc
  },

JSON文件:

当我运行上述 Web 应用程序时,我发现网页下方

选择后Sign Up/In,我得到如下登录屏幕:

当我进入我的证书,我成功登录到应用程序,如下所示:

当我点击Sign Out,它通过让我退出显示在屏幕下方:

【讨论】:

    猜你喜欢
    • 2018-04-11
    • 2021-05-28
    • 2020-08-12
    • 2014-05-20
    • 2020-09-21
    • 1970-01-01
    • 2020-03-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多