Okta 在 Azure AD B2C 中用作 OpenID IDP 提供程序时重定向 URI

Okta redirect URI when used as OpenID IDP provider in Azure AD B2C

我正在尝试将 Okta 设置为我的 Azure AD B2C 租户中的 OpenID Connect 提供商。我的配置有问题。当我测试 B2C 用户流程时抛出错误:

Error Code: invalid_request
Description: The 'redirect_uri' parameter must be a Login redirect URI in the client app 

这是我遵循的步骤

八达

https://B2CTenantName.b2clogin.com/B2C tenant ID/oauth2/authresp https://colinwurtzb2c.b2clogin.com/eb178344-61bd-4822-95cf-7a251aaba527/oauth2/authresp

蔚蓝

我认为您需要使所使用的 URL 模式/租户标识符保持一致。如果您使用 https://colinwurtzb2c.b2clogin.com/eb178344-61bd-4822-95cf-7a251aaba527/oauth2/authresp (using tenant Id) then you need to open your user flow also using tenant Id. Your screen shows the default Azure Portal option with tenant name, so the URL starts with https://colinwurtzb2c.b2clogin.com/colinwurtzb2c.onmicrosoft.com/(...) 设置 Okta 应用程序。 我的猜测是,在这种情况下,AAD B2C 使用 https://colinwurtzb2c.b2clogin.com/colinwurtzb2c.onmicrosoft.com/oauth2/authresp 向 Okta 发出请求,这与您设置的请求不同,因此会出现错误。 因此,要么使用包含租户名称的 URL 设置 Okta,要么在 运行 AAD B2C 用户流时使用租户 ID。

除了与 link 保持一致外,我还必须在自定义 IDP 屏幕中添加一些范围,并在声明映射部分将 email 映射到 User ID