Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

B2C Custom Content - Output claim value as hidden field

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
like image 237
felickz Avatar asked Oct 20 '25 10:10

felickz


1 Answers

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

like image 107
felickz Avatar answered Oct 22 '25 04:10

felickz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!