title: Azure B2C custom attribute/claim added to existing user directory throws error on sign in
body: <p>I have a custom policy which adds a custom value, <code>HoldingId</code>, to new users who sign up (<a href="https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-create-custom-attributes-profile-edit-custom" rel="nofollow noreferrer">using these docs</a>) as the value is passed to the policy via the token (along with <code>verified_email</code>).</p>
  
  <p>I was hoping to <em>not</em> need to create a custom policy for <strong>sign in</strong>, so used the Azure Portal UI to create the custom attribute against the <strong>b2c-extensions-app</strong> application (and am using the respective <em>client</em> and <em>object</em> ids to line it up with the custom policy), and using the Portal have added this custom attribute to the <strong>sign up/sign in</strong> policy claims.</p>
  
  <p>Using the Graph API, I have been able to successfully confirm that the custom value is saving against newly signed up users (returning as <code>extension_[AppId]_HoldingId</code>), and these new users are able to sign in subsequently without issue using the built in <strong>sign in/sign up</strong> policy.</p>
  
  <p>However, any <strong>users which already existed in the directory are no longer able to sign in</strong>. Unfortunately, because it's a built-in policy, I'm not sure of a way to dig into the logs a-la <em>App Insights</em> to see what's going on.</p>
  
  <p>My <em>suspicion</em> is that because these existing users don't have this custom attribute against them, the built-in <strong>sign up/sign in</strong> policy is attempting to get this value and failing.</p>
  
  <p>Is it possible to get the built-in policies to ignore this attribute on users who don't have this attribute set, or will I need to create a custom policy to handle this scenario with a default value?</p>
  
  <hr>
  
  <p>For context, the <code>HoldingId</code> is not required for <em>existing</em> users (application needs to be backwards compatible). <em>This is also my first venture into B2C, so I'm still learning many of these concepts.</em></p>