title: How to resolve error The specified alg value is not allowed in django
body: <p>I am trying to decode some JWT string that I have received from an authentication service but I'm getting an error <code>The specified alg value is not allowed</code>. What could be the issue? I verified that the algorithim I should use is <strong>HS256</strong>.</p>
  
  <p>When I try to decode the JWT string at <a href="https://jwt.io/" rel="nofollow noreferrer">https://jwt.io/</a> it's being decoded.</p>
  
  <p><strong>code snippet</strong></p>
  
  <pre><code>    try:
          print(jwt_value)
          decoded = jwt.decode(jwt_value, 'secret', algorithms=['HS256'])
          print(decoded)
      except Exception as e:
          print(e)
  </code></pre>
  
  <p><strong>JWT Settings</strong> </p>
  
  <pre><code>JWT_AUTH = {
      # 'JWT_EXPIRATION_DELTA': datetime.timedelta(seconds=36000),
      'JWT_ENCODE_HANDLER':
      'rest_framework_jwt.utils.jwt_encode_handler',
  
      'JWT_DECODE_HANDLER':
      'rest_framework_jwt.utils.jwt_decode_handler',
  
      'JWT_PAYLOAD_HANDLER':
      'sbp.custom_jwt.jwt_payload_handler',
  
      'JWT_PAYLOAD_GET_USER_ID_HANDLER':
      'rest_framework_jwt.utils.jwt_get_user_id_from_payload_handler',
  
      'JWT_RESPONSE_PAYLOAD_HANDLER':
      'sbp.custom_jwt.jwt_response_payload_handler',
  
      'JWT_SECRET_KEY': 'secret',
      'JWT_GET_USER_SECRET_KEY': None,
      'JWT_PUBLIC_KEY': None,
      'JWT_PRIVATE_KEY': None,
      'JWT_ALGORITHM': 'HS256',
      'JWT_VERIFY': True,
      'JWT_VERIFY_EXPIRATION': True,
      'JWT_LEEWAY': 0,
      'JWT_EXPIRATION_DELTA': datetime.timedelta(seconds=36000),
      'JWT_AUDIENCE': None,
      'JWT_ISSUER': None,
  
      'JWT_ALLOW_REFRESH': False,
      'JWT_REFRESH_EXPIRATION_DELTA': datetime.timedelta(days=7),
  
      'JWT_AUTH_HEADER_PREFIX': 'JWT',
      'JWT_AUTH_COOKIE': None,
  }
  </code></pre>