title: Is it possible to set a boolean-value claims in your Identity Token with Duende Identity Server 5?
body: <p>I'm trying to set a custom claim with some code for Duende Identity Server 5.2.3.</p>
  <p>The claim works / is added, but it's a string and not a boolean.
  I've notied -another- claim inthe JWT that <em>is a boolean</em> so I'm wondering, can I do this also?</p>
  <p>Here's the code and then the sample JWT:</p>
  <pre><code>public class CustomTokenService : DefaultTokenService
  {
      public override async Task&lt;Token&gt; CreateIdentityTokenAsync(TokenCreationRequest request)
      {
          var token = await base.CreateIdentityTokenAsync(request);
  
          bool isThisInAGracePeriod = true; // for example ...
  
          // This doesn't work. There's no bool overload, for the 2nd argument.
          // var myClaim = new Claims(&quot;in_grace_period&quot;, isThisInAGracePeriod);
  
          // I need to convert the bool to a string, using ToString();
          var myClaim = new Claims(&quot;in_grace_period&quot;, isThisInAGracePeriod.ToString());
  
          token.Claims.Add(myClaim);
      }
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/noK9t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/noK9t.png" alt="enter image description here" /></a></p>
  <p>so notice:</p>
  <ul>
  <li><code>email_verified</code> is a <code>bool</code> value</li>
  <li><code>in_grace_period</code> is a <code>string</code> value (because I had to <code>ToString()</code> it :(  )</li>
  </ul>
  <p>Is it possible to add my custom claim as a <code>bool</code> so it ends up looking like how <code>email_verified</code> is serialized out to the token payload?</p>