title: How to decode custom token generated using firebase admin NodeJS sdk
body: <p>I am using firebase nodejs admin sdk to generate a custom token that is later sent to android client. I have been successful with generating the token using <code>admin.auth().createCustomToken()</code>. However, I need to decode this token to get the <code>uid</code> and other custom claims that was set when generating the token.</p>
  <p>I have searched and it seems firebase do not have an out of the box solution using it's admin sdk to decode the custom token (Correct me if i'm wrong).</p>
  <p>The solution I have found is using <code>signInWithCustomToken()</code> to first get the idToken and then using firebase's admin sdk <code>verifyIdToken</code> method to get the uid.
  I'm a bit skeptical about this solution as I don't think it can provide access to the custom claims I set originally.</p>
  <p>The other solution I've found is using <code>jwt</code> nodejs module to decode this token. However, <code>jwt</code> requires an API key to decode this token. Not sure about the API key since I used a service account to generate the token in the first place.</p>
  <p>Now the questions:</p>
  <ol>
  <li>How best can I decode this token in nodejs?</li>
  <li>Do the admin sdk for firebase not have any built in method to decode this token directly just as it was able to create the token?</li>
  </ol>
  <p>Edit
  As Doug has pointed, the reason I need to decode the token is to get the uid (string) and an additional claim which has the user_id (int) associated with a postgres users table that was set during signup. These ids are used to authorise certain http requests</p>
  <p>Also I happen to append the custom token as a query parameter to a password reset link. Hence I need to decode the token to know which user owns it.</p>