我们如何从 Azure AD B2C 登录的登录页面中删除“忘记密码”链接。
谢谢。
在 Azure B2C 策略的文档中,在 SSO 会话 ( https://learn.microsoft.com/en-au/azure/active-directory-b2c/active-directory-b2c-reference-sso-custom ) 下没有提及技术政策下可用的要素。
然而,在入门包代码(例如https://github.com/Azure-Samples/active-directory-b2c-custom-policy-starterpack/blob/master/SocialAndLocalAccountsWithMfa/TrustFrameworkBase.xml)中,始终使用该元素。
在 TechnicalProfiles 的参考文档中,甚至没有提到该元素(https://learn.microsoft.com/en-au/azure/active-directory-b2c/technicalprofiles)
有谁知道该元素实际上有什么作用?我的猜测是,它会阻止该技术配置文件使用现有会话,但在什么情况下我应该使用它,什么情况下不应该使用它?
我按照这篇文章将电子邮件和displayName作为id_token_hint传递给我的自定义策略。以下是我用来提取数据的技术简介:
<TechnicalProfiles>
<TechnicalProfile Id="IdTokenHint_ExtractClaims">
<DisplayName> My ID Token Hint TechnicalProfile</DisplayName>
<Protocol Name="None" />
<CryptographicKeys>
<Key Id="client_secret" StorageReferenceId="B2C_1A_ClientAssertionSigningKey" />
</CryptographicKeys>
<OutputClaims>
<!--Sample: Read the email cliam from the id_token_hint-->
<OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="newUserEmail"/>
<OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="displayName"/>
</OutputClaims>
</TechnicalProfile>
Run Code Online (Sandbox Code Playgroud)
问题是,我只能提取电子邮件值。未提取 displayName 声明类型。我检查了jwt.ms中的id_token_hint值,其中存在电子邮件和 displayName 的值。我该如何解决这个问题?
用户故事:给定一个 ADB2C 用户,具有全局管理员角色和 oid 01234567-901a-bcde-f012-3456789abcde(不是真正的 oid),我希望能够以该用户身份登录并从“ https://graph.microsoft.com”检索用户配置文件/beta/me ”或“ https://graph.microsoft.com/beta/users/01234567-901a-bcde-f012-3456789abcde ”。文档中将两者列为 B2C 的有效端点。
在仅分配了 Microsoft Graph 权限范围的应用程序注册中,我使用邮递员请求不记名令牌以访问 MS Graph。有一个 Web 重定向 URI ( https://oauth.pstmn.io/v1/callback )、一个客户端密钥,并且对访问令牌和 ID 令牌均启用隐式授予。
要求的范围是:openid offline_access https://graph.microsoft.com/Directory.AccessAsUser.All
同样,B2C 用户帐户具有全局管理员角色。
AADB2C90205:此应用程序没有足够的权限对此 Web 资源执行该操作。
我的租户中的应用程序有一个用户流程,B2C_1_postman基本上是默认的。它与邮递员、其他测试应用程序以及 B2C 管理刀片中的“运行用户流程”功能配合得很好。
身份验证端点是:
https://{Tenant}.b2clogin.com/{Tenant}.onmicrosoft.com/B2C_1_postman/oauth2/v2.0/authorize
Run Code Online (Sandbox Code Playgroud)
令牌端点是:
https://{Tenant}.b2clogin.com/{Tenant}onmicrosoft.com/B2C_1_postman/oauth2/v2.0/token
Run Code Online (Sandbox Code Playgroud)
我已经通过 Microsoft 的 github 存储库中的几个桌面演示复制了此行为,现在又使用 Postman。该应用程序名为“postman”,位于 ADB2C 租户中。我授予它以下应用程序 API 范围:
Directory.AccessAsUser.All
Directory.Read.All
Directory.ReadWrite.All
Directory.email
Directory.offline_access
Directory.profile
Run Code Online (Sandbox Code Playgroud)
此过程反映了https://github.com/Azure-Samples/active-directory-b2c-dotnet-desktop上的桌面演示的设置,唯一的例外是我想要我的桌面应用程序,而不是 NodeJS 示例应用程序使用 MS Graph。(如果我添加示例应用程序的端点,则此应用程序注册工作得很好。但指定 MS Graph 范围始终返回空访问 ID。)
我怎样才能让它发挥作用?
我已经能够创建 Azure Functions App 来管理 Azure B2C 用户。我可以使用 client_credentials Flow 创建新用户并完美更新配置文件。但是,当我使用带有正文的 PATCH 请求更改密码时:
{
passwordProfile: {
password: 'password-value',
forceChangePasswordNextSignIn: false
},
passwordPolicies: "DisablePasswordExpiration"
}
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
{code: 'Authorization_RequestDenied', message: 'Insufficient privileges to complete the operation.'}
Run Code Online (Sandbox Code Playgroud)
我对此做了一些研究,并发现更新密码需要委派权限“Directory.AccessAsUser.All”。在前端应用程序中,我使用 B2CLogin 流程登录,因此访问令牌与 Graph API 不兼容。此外,B2C 应用程序中的应用程序级别不存在“Directory.AccessAsUser.All”。因此,我也无法将补丁请求与 client_credentials 流程一起使用。根据一些建议,该过程可以通过 Azure AD PowerShell 通过分配“公司管理员”角色来完成。但是,我还没有找到通过Azure Function重置密码的解决方案。分步解决方案(如果存在)对我来说非常有帮助,因为我对 Azure 服务相对较新。
我正在尝试使用 PKCE 一个有角度的项目来实现授权代码流。我正在使用 angular-auth-oidc-client。我们已经有一个基于 IdentityServer4 的现有内部实施,客户端可以很好地配合该实施,但我们现在正在尝试将身份验证迁移到 Azure AD B2C,而不是在内部实施。
我已经配置了 Azure AD B2C 和我的客户端应用程序。这是配置:

这是我在客户端 OIDC 服务上的配置:
oidcConfigService.withConfig({
stsServer: 'https://login.microsoftonline.com/mycompany.onmicrosoft.com/v2.0',
authWellknownEndpoint:
'https://mycompany.b2clogin.com/mycompany.onmicrosoft.com/B2C_1_SignUpSignIn/v2.0/.well-known/openid-configuration',
redirectUrl: window.location.origin,
postLogoutRedirectUri: window.location.origin,
clientId: 'client-id-guid-goes-here',
scope: 'openid profile offline_access',
responseType: 'code',
silentRenew: true,
autoUserinfo: false,
silentRenewUrl: window.location.origin + '/silent-renew.html',
logLevel: LogLevel.Debug,
renewTimeBeforeTokenExpiresInSeconds: 60
});
Run Code Online (Sandbox Code Playgroud)
即使我在客户端配置中选中了 accesss_token 复选框。我在这里缺少什么?
access-token openid-connect azure-ad-b2c pkce angular-auth-oidc-client
我的 Django 应用程序有三个基本环境。我想使用 Azure AD B2C 作为我的应用程序的身份提供程序。但我对以下几点有点困惑
我们是否需要为每个环境创建单独的 Azure AD B2C 租户?就像现在,我的 Django 应用程序有三个环境,所以我将创建 3 个租户。
或者,如果我使用单个 Azure AD B2C 租户,我将如何区分 DEV、STAGE 和 PROD 用户?
提前致谢。
关于子旅程的文档似乎有限。https://learn.microsoft.com/en-us/azure/active-directory-b2c/subjourneys
我在 SubJourney 中遇到一个问题,我读取用户并获取对象 ID。在主 UserJourney 中,我后来使用该对象 Id 再次读取用户,但它抱怨。
尽管 objectId 是子旅程第一步中的输出声明,但主用户旅程无法使用该输出。
<SubJourneys>
<SubJourney Id="ResetPhoneNumberOnAccount" Type="Call">
<OrchestrationSteps>
<!-- Look to see if the user exists if its a phone recovery -->
<OrchestrationStep Order="1" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="CheckIfUserExists" TechnicalProfileReferenceId="AAD-UserDiscoveryUsingLogonPhoneNumber-FullProfile" />
</ClaimsExchanges>
</OrchestrationStep>
<!-- Other Step -->
</SubJourney>
</SubJourneys>
Run Code Online (Sandbox Code Playgroud)
AAD-UserDiscoveryUsingLogonPhoneNumber-FullProfile 定义:https://github.com/Azure-Samples/active-directory-b2c-custom-policy-starterpack/blob/master/scenarios/phone-number-passwordless/Phone_Email_Base.xml#L905
SubJourneys 是否无法向链上发送输出声明?
azure-ad-b2c identity-experience-framework azure-ad-b2c-custom-policy
我对 Azure Active Directory 比较陌生,并试图了解管理应用程序使用的自定义角色和权限的一些最佳实践或指南。
例如,我可能想创建一个“技术人员”角色,他们拥有诸如“firmware.upgrade”或“product.view”之类的权限,可以在应用程序和端点中强制执行。
那么“技术人员”实际上是一个 Azure AD 组吗?我可以将自定义角色“firmware.upgrade”和“product.view”分配给该组吗?甚至可以这样工作吗?
另外,我可以考虑应用程序角色,但“技术员”(和其他)将是跨多个应用程序使用的角色。所以我不确定应用程序角色是否有意义使用。
azure-ad-b2c ×10
azure ×3
identity-experience-framework ×2
access-token ×1
permissions ×1
pkce ×1
roles ×1