title: How to generate JWT in python according to the requirement
body: <p>I'm trying to generate JWT to use it in a API integration. <a href="https://developers.miro.com/docs/boards-picker#section-generate-jwt-on-your-backend" rel="nofollow noreferrer">Here</a> are the specific requirements to generate JWT token but I'm not following how to do it in python.</p>
  <p>It shows following Java snippet:</p>
  <pre><code>JWT.create()  
     .withIssuer(&quot;CLIENT_ID&quot;)
     .withExpiresAt(new Date(System.currentTimeMillis() + TimeUnit.MINUTES.toMillis(5)))
     .sign(Algorithm.HMAC256(&quot;CLIENT_SECRET&quot;));
  </code></pre>
  <p>And accordingly, I'm trying to create it...
  Here I'm using <a href="https://pypi.org/project/jwt/" rel="nofollow noreferrer">JWT</a> lib in python and here is my code:</p>
  <pre class="lang-py prettyprint-override"><code>from datetime import datetime, timedelta, timezone    
  from jwt import JWT
  from jwt.utils import get_int_from_datetime
      
  instance = JWT()
      
  message = {
     'iss': 'CLIENT_ID',
     'exp': get_int_from_datetime(datetime.now(timezone.utc) + timedelta(hours=23))
  }
      
  signing_key = 'CLIENT_SECRET'
      
  compact_jws = instance.encode(message, signing_key, alg='HS256')
  print('compact_jws', compact_jws)
  </code></pre>
  <p>But the above code gives me the following error:</p>
  <blockquote>
  <p>TypeError: key must be an instance of a class implements jwt.AbstractJWKBase</p>
  </blockquote>
  <p>I'm not sure whether the code I've written is correct according to the requirements or not, please help me.</p>