title: How can I sign a JWT to exchange an access token from azure active directory?
body: <p>I am coding by nodejs and I am referring to this doc : </p>
  
  <p><a href="https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-oauth2-client-creds-grant-flow#second-case-access-token-request-with-a-certificate" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-oauth2-client-creds-grant-flow#second-case-access-token-request-with-a-certificate</a></p>
  
  <p>As this doc said , I can get an access token by a JWT token . This doc indicated how to sign a JWT :</p>
  
  <p><a href="https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-certificate-credentials" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-certificate-credentials</a></p>
  
  <p>but I can't find any demo code about it.So how can I implement it to get an access token to call microsoft graph apis by nodejs ? </p>
  
  <p>Any assistance is appreciated, thanks !</p>