Is there a way to output a claim as a hidden field (input type="hidden") so that it can be used inside custom JavaScript inside AAD B2C?
Setting a default value on a "ReadOnly" DisplayClaim gets the value out to the page:
<ClaimType Id="myClaim">
<DisplayName>DEBUG: Never display this</DisplayName>
<DataType>string</DataType>
<UserInputType>Readonly</UserInputType>
</ClaimType>
but then you have to goto extra lengths to hide it that may become fragile if the B2C HTML DOM output format ever changes:
var myClaim = document.getElementById("myClaim"); //too bad this cant just be a hidden field
var myClaimValue = myClaim.value;
myClaim.parentElement.parentElement.style.display = "none"; //hide parent div's parent li
As commented on initial question, this is not supported currently.
If you ended up on this post, please upvote this feature request: https://feedback.azure.com/d365community/idea/5f39dfe1-b625-ec11-b6e6-000d3a4f0789
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With