title: How do I verify a JSON Web Token using a Public RSA key?
body: <p>New question to keep this question specific and to the point.</p>
  
  <p>I have a JWT from Azure and now I need verify the signature in my application.</p>
  
  <p>The public keys from Microsoft can be found here:</p>
  
  <p><a href="https://login.windows.net/common/discovery/keys" rel="noreferrer">https://login.windows.net/common/discovery/keys</a></p>
  
  <p>How do I use these keys to verify a signature? I can tell these these are the public keys I need as the X5T header in the JWT matches those on this public key list.</p>
  
  <p>I am using the JWT PHP library but everything I enter as the public key seems to fail.</p>
  
  <pre><code>supplied key param cannot be coerced into a public key
  </code></pre>
  
  <p>So using the link above, that goes from there into the PHP
  openssl_verify function as parameter three ($key in the example below)?</p>
  
  <pre><code>$success = openssl_verify($msg, $signature, $key, 'SHA256')
  </code></pre>
  
  <p>Everything I enter causes an error in one way or another.</p>
  
  <p>Thanks,</p>