如何在ADB2C中使用用户名读取用户?

huangapple go评论81阅读模式
英文:

How to read users using username in ADB2C?

问题

我如何使用用户名定义具有操作“读取”的技术配置文件?我尝试将输入类型设置为“signInNames.userName”、“signInNames.username”,但ADB2C页面直接抛出异常错误,没有ADB2C代码。

这是我定义的signInNames.userName声明类型。这应该受到责备吗?

  1. <ClaimType Id="signInNames.userName">
  2. <DisplayName>登录名</DisplayName>
  3. <DataType>string</DataType>
  4. <UserHelpText/>
  5. <UserInputType>TextBox</UserInputType>
  6. </ClaimType>
  7. <TechnicalProfile Id="AAD-UserReadUsingUsername">
  8. <Metadata>
  9. <Item Key="Operation">Read</Item>
  10. <Item Key="RaiseErrorIfClaimsPrincipalDoesNotExist">true</Item>
  11. </Metadata>
  12. <IncludeInSso>false</IncludeInSso>
  13. <InputClaims>
  14. <InputClaim ClaimTypeReferenceId="signInNames.userName" Required="true" />
  15. </InputClaims>
  16. <OutputClaims>
  17. <!-- 可选声明 -->
  18. <!-- <OutputClaim ClaimTypeReferenceId="signInNames.userName" /> -->
  19. <OutputClaim ClaimTypeReferenceId="objectId" />
  20. <OutputClaim ClaimTypeReferenceId="displayName" />
  21. <OutputClaim ClaimTypeReferenceId="otherMails" />
  22. <OutputClaim ClaimTypeReferenceId="givenName" />
  23. <OutputClaim ClaimTypeReferenceId="surname" />
  24. </OutputClaims>
  25. <IncludeTechnicalProfile ReferenceId="AAD-Common" />
  26. </TechnicalProfile>
英文:

How do I define a technical profile with operation "read" using username? I tried input type as "signInNames.userName", "signInNames.username" - but the adb2c page directly throwns an exception error without a ADB2C code.

This is how I defined the signInNames.userName claimtype. Is this to be blamed?

  1. &lt;ClaimType Id=&quot;signInNames.userName&quot;&gt;
  2. &lt;DisplayName&gt;Sign in name&lt;/DisplayName&gt;
  3. &lt;DataType&gt;string&lt;/DataType&gt;
  4. &lt;UserHelpText/&gt;
  5. &lt;UserInputType&gt;TextBox&lt;/UserInputType&gt;
  6. &lt;/ClaimType&gt;
  1. &lt;TechnicalProfile Id=&quot;AAD-UserReadUsingUsername&quot;&gt;
  2. &lt;Metadata&gt;
  3. &lt;Item Key=&quot;Operation&quot;&gt;Read&lt;/Item&gt;
  4. &lt;Item Key=&quot;RaiseErrorIfClaimsPrincipalDoesNotExist&quot;&gt;true&lt;/Item&gt;
  5. &lt;/Metadata&gt;
  6. &lt;IncludeInSso&gt;false&lt;/IncludeInSso&gt;
  7. &lt;InputClaims&gt;
  8. &lt;InputClaim ClaimTypeReferenceId=&quot;signInNames.userName&quot; Required=&quot;true&quot; /&gt;
  9. &lt;/InputClaims&gt;
  10. &lt;OutputClaims&gt;
  11. &lt;!-- Optional claims --&gt;
  12. &lt;!-- &lt;OutputClaim ClaimTypeReferenceId=&quot;signInNames.userName&quot; /&gt; --&gt;
  13. &lt;OutputClaim ClaimTypeReferenceId=&quot;objectId&quot; /&gt;
  14. &lt;OutputClaim ClaimTypeReferenceId=&quot;displayName&quot; /&gt;
  15. &lt;OutputClaim ClaimTypeReferenceId=&quot;otherMails&quot; /&gt;
  16. &lt;OutputClaim ClaimTypeReferenceId=&quot;givenName&quot; /&gt;
  17. &lt;OutputClaim ClaimTypeReferenceId=&quot;surname&quot; /&gt;
  18. &lt;/OutputClaims&gt;
  19. &lt;IncludeTechnicalProfile ReferenceId=&quot;AAD-Common&quot; /&gt;
  20. &lt;/TechnicalProfile&gt;

答案1

得分: 0

请看这个示例

收藏中还有其他与用户名相关的内容。

英文:

Have a look at this sample.

There are also others in the collection to do with username.

huangapple
  • 本文由 发表于 2023年5月22日 23:06:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/76307547.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定