title: How to verify custom Firebase Auth Token, created by createCustomToken()
body: <p>I created custom Auth Token via createCustomToken(), see <a href="https://firebase.google.com/docs/auth/admin/create-custom-tokens" rel="noreferrer">https://firebase.google.com/docs/auth/admin/create-custom-tokens</a>.</p>
  
  <p>But later on when I try to verify this token via verifyIdToken() function it  throws following error</p>
  
  <pre><code>Error: verifyIdToken() expects an ID token, but was given a custom token. See https://firebase.google.com/docs/auth/admin/verify-id-tokens for details on how to retrieve an ID token.
  </code></pre>
  
  <p>Which is rational, because there is no such ID... But what I need - is to simply verify the token, similar to jwt.verify()... </p>
  
  <p>Has anyone came across this problem and what solution was found? Is it possible to verify Firebase auth token via jsonwebtoken library?</p>
  
  <p>P.S. I am gonna use verification in Google Cloud Function endpoints</p>
  
  <p>SOLUTION: Looks like I just found a solution <a href="https://firebase.google.com/docs/auth/admin/verify-id-tokens#verify_id_tokens_using_a_third-party_jwt_library" rel="noreferrer">https://firebase.google.com/docs/auth/admin/verify-id-tokens#verify_id_tokens_using_a_third-party_jwt_library</a> Just need to grap public key from <a href="https://www.googleapis.com/robot/v1/metadata/x509/securetoken@system.gserviceaccount.com" rel="noreferrer">https://www.googleapis.com/robot/v1/metadata/x509/securetoken@system.gserviceaccount.com</a> and use jsonwebtoken library to verify it...</p>